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个字节。

c语言的结构体字节数统计,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!