declaration with typedef

Hamad Mohammad h.battel at hotmail.com
Mon Dec 27 06:44:38 PST 2010


excuse me

but why that code works

struct Human
{
    string name;
    int age;
}
void main()
{
    Human person1;
    person1.name = "aaaa";
    person1.age = 12;
    writeln(person1.age);
    typedef Human Mankind;
    Mankind person2;
    person2.name = "bbbb";
    person2.age = 14;
    writeln(person2.age);
}





More information about the Digitalmars-d-learn mailing list