1.从堆区申请能存5个结构体变量的数组的空间,完成数组中成员的输入,根据学生成绩,用选择排序的方式,对学生排序并输出。
2.求以下结构体的大小
typedef struct{
int id; -->4
char name[50]; -->50
char grade[3]; -->3 -->57(4的倍数)
} Student;
答案:60
typedef struct {
int id; -->4
char name[50]; -->50
Student student; -->60 -->114(4的倍数)
} Teacher;
答案:116
typedef struct {
int id; -->4
char name[50]; -->50
Teacher teacher; -->116 -->170(4的倍数)
} Course;
答案:172