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; 相关推荐
查看12道真题和解析
嵌入式的小白:很多面试,面试前不会去打扰cto的,但一般cto不会在这些小事上刷人,只能说这个cto比较操心,啥重要不重要,紧急不紧急的,估计都会过问,平淡看待吧招聘动态