c语言的结构体字节数统计
时间:2014-06-25 21:13:46
收藏:0
阅读:235
struct结构体的字节数 等于 结构体中最大类型的字节数的倍数。
如:?
typedef struct Student
{
??? short id; //2个字节
??? char name[15]; //1*15个字节
??? int age; //4个字节
??? char num; //1个字节
} Student;
总共28个字节。
评论(0)