When allocating memory, there can be multiple alignment, defined as follows: #pragma pack (n); (n = 1, 2, 4, 8, 16) If it is n = 4, then any variable in the structure will not Cross the 4-byte boundary, such as the following example: #pragma pack (n) struct s {char i; short j; short k; char m;} #pragma pack () if n = 1 sizeof (s) = 6; if n = 4 SizeOf (s) = 8; because K cannot span the boundary of 4 bytes.