对齐规则
—-对于union和struct占用内存大小的探讨:
union:what is the definition of union?The whole members of union share the same memory in your computer!
struct:struct is the same as set,including lots of data members in different types!
(there is any syntax error?)
++The main body:++
- 结构体当前成员从其大小(或者其成员大小)的整数倍开始存;
- 结构体作为成员:那么该结构体内部最大成员的整数倍开始存;
- 结构体或联合体的大小,为其最大成员大小的整数倍,不足则补齐;
++some instances:++
1 | /* |
++reslut of ex:++