typedef union
{long i;int k[5];char c} DATA;
struct date {int cat;DATA cow;double dog;} too; DATA max; printf("%d", sizeof(struct date)+sizeof(max)); 解析: DATA 是一个共用体,变量共同使用空间,最大的为int k[5] ,占用20字节 date 大小为 int 4 + DATA 20 + double 8 = 32。 所以结果是20 + 32 = 52。 |