对齐方式是4或8字节
union:
32位机是以四个字节对齐如
union{long i;int k[5];char c;} 20个字节
64位机8字节或4字节对齐(出现long或double等8字节则8字节对齐)
union{long i;int k[5];char c;} 24个字节;union{int i;int k[5];char c;} 20个字节;union{int i;int k[5];long c;}24个字节;
struct:
32位机
typedef union{long i;int k[5];char c;}DATE(20); struct C{ int cat;DATE cow;double dog;};(32)
64位机
typedef union{long i;int k[5];char c;}DATE(24); struct C{ int cat;DATE cow;double dog;};(40)