Template:cpp/preprocessor/pragma pack

This family of pragmas control the maximum alignment for subsequently defined and union members.

where is a small power of two and specifies the new alignment in bytes.

@1@ Sets the current alignment to value.

@2@ Sets the current alignment to the default value (specified by a command-line option).

@3@ Pushes the value of the current alignment on an internal stack.

@4@ Pushes the value of the current alignment on the internal stack and then sets the current alignment to value.

@5@ Pops the top entry from the internal stack and then sets (restores) the current alignment to that value.

may decrease the alignment of a, however, it cannot make a overaligned.

See also specific details for GCC and MSVC.