设有以下说明和定义:
typedef union
{long i;int k[5];char c;
} DATE;
struct data
{int cat;DATE cow;double dog;
} too;
DATE max;
则语句 printf("%d",sizeof(struct date)+sizeof(max));的执行结果是:
分析:
16位编译器中,union = 5*2 = 10
data = int 2 + 10 + 8 = 20
此时结果为30
32位编译器中:union = 5*4 = 20
Data = int 4+ union 20 + double 8 = 32
此时结果为52