How do you do it?
plz and thank you.
How do you do it?
plz and thank you.
anyone??????? i didn't realise that the question was that hard.
You can nest structs, no problem:
//etc.Code:struct NAME { char fname[20]; char lname[20]; } struct student { struct NAME; int ID; char major[30]; char advisor[30]; float GPA; }students[50]; Access is via the dot operator: for(i = 0; i < 50; i++) printf("%s", students[i].NAME.fname);
In real code, you'd want just the definition of the structs global, and the declarations of the students array to be done in main(), probably.
thank you.
You're quite welcome, J.
> anyone??????? i didn't realise that the question was that hard.
You only waited 15 minutes before deciding it was too hard.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
... and at midnight.