C / C ++ cancel byte alignment structure

Alignment is relatively difficult to understand the problem, after a period of time may make sense if they forget, as a direct Unalign, configuration code is as follows:

#pragma pack (n) // compiler aligned in n bytes;
#pragma pack () // restore the previous pack is provided, arranged to cancel byte alignment
#pragma pack (pop) // restore the previous pack set, byte alignment unset
#pragma Pack (1) // performed by 1 byte alignment namely: not to be aligned
so only to the last sentence, pay attention to both sides need to cancel the agreement in Canada includes byte alignment

Guess you like

Origin www.cnblogs.com/judes/p/12324418.html