c语言的结构体字节数统计

struct结构体的字节数 等于 结构体中最大类型的字节数的倍数。


如: 
typedef struct Student
{
    short id; //2个字节
    char name[15]; //1*15个字节
    int age; //4个字节
    char num; //1个字节
} Student;

总共28个字节。

posted @ 2014-06-24 09:30  xclidongbo  阅读(615)  评论(3编辑  收藏  举报