第1个回答 2013-11-20
typedef struct student {
char name[128];
int age;
// ...
}student_t, *student_link;
struct score {
int math;
int physical;
//...
}score_t, *score_link;
struct teacher {
char name[128];
int teach_type;
//...
}teacher_t, *teacher_link;
typedef struct myclass {
student_link stu_link;
score_link score_info;
teacher_link teacher_info;
}myclass_t;
void create_student_info(student_link *s) {
student_link l = *s;
student_t *p = l;
// create your student info here.
}
int main()
{
myclass_t cls;
cls.stu_link = NULL;
cls.score_info = NULL;
cls.teacher_info = NULL;
create_student_info(&(cls.stu_link));
return 0;
}本回答被提问者采纳