请假sizeof问题
#include "iostream.h"#include "iomanip.h"
struct student
{
char id[10];
char name[20];
char sex;
int age;
char department[30];
float score;
};
void main(){
student student1 = {"05030100","WangWei",'M',20,"Computer",95},
student2 = {"05030101","LiMing",'M',21,"Physic",98};
float average;
cout<<student1.age<<" "<<student1.department<<" "<<student1.id<<" "<<student1.name<<" "<<student1.score<<" "<<student1.sex<<endl;
cout<<student2.age<<" "<<student2.department<<" "<<student2.id<<" "<<student2.name<<" "<<student2.score<<" "<<student2.sex<<endl;
average = (student1.score+student2.score)/2;
cout<<"average="<<average;
cout<<"sizeofstudent1="<<sizeof(student1)<<endl;
}
为什么sizeof(student1)=72?