C++ union联合体
为什么这样写union,求得的sizeof(m)为4,
union m{ struct s{ int x,y,z; }; int a; } ;
而这样写的话,sizeof(m)就是12呢?
union{ struct { int x,y,z; }s; int a; } m;
union m{ struct s{ int x,y,z; }; int a; } ;
union{ struct { int x,y,z; }s; int a; } m;
相关推荐