Generally, the default association conditions can be changed by the following method:
• Use the pseudo command #pragma Pack ([N])
#pragma pack ([n]) The pseudo-instruction allows you to select a compiler to be a governor policy taken by the data allocation space.
For example, after using the #pragma pack (1) pseudo, the spatial allocation of each member of the TEST structure is aligned according to one byte, the format is as follows:
#pragma pack (push) // Save the alignment status
#pragma pack (1)
// Define your structure
// ..........
#pragma pack (POP)
Moderator:
Alignment has always been a problem that beginners is confused, I hope this article can help