#include <stdio.h>

struct test1{
    char a1;
    int a2;
    double a3;
};

struct test2{
    char a1;
    struct test1 t;
};

int main(void)
{
    printf("%d\n",sizeof(struct test1));
    printf("%d\n",sizeof(struct test2));


    return 0;
}

 

 

用gcc编译 为16 20

用VC编译 为16 24

posted on 2014-03-28 08:50  linghuchong0605  阅读(135)  评论(0编辑  收藏  举报