Specify alignment values:#pragma pack (n),n=1,2,4,8,16 changes the alignment factor of the system
Structs and unions are composed of several different data type members, but at any one point, the union only holds a selected member, and all members of the struct exist.
In a struct, each member occupies its own memory space, which is present at the same time.
The total length of a struct variable equals the sum of all member lengths.
In union, all members cannot occupy their memory space at the same time, and they cannot exist at the same time.
The length of the union variable equals the length of the longest member.
Assigning values to different members of union will be overridden for other members, the original member's value will not exist, and the different member assignments for the struct are not affected.
Http://www.cnblogs.com/LUO77/p/5771237.html
Common C + + interview Summary