member is padded with the number of bytes required so that the total size of the structure should be a multiple of the largest alignment of any structure member (alignment(int) in this case, which = 4 on linux-32bit/gcc). In this case 3 bytes are added to the last member to pad the structure to the size of 12 bytes (alignment(int) × 3). struct FinalPad { float x; char n[1]; }; In this example the total size of the structure , not 5 (so that the size is a multiple of 4 (alignment of float)). struct FinalPadShort { short s; char n[3]; }; In this example the total size of the structure , not 5 (not 8 either) (so that the size is a multiple of 2 (alignment(short) = 2 on linux-32bit/gcc)). It is possible to change the alignment of structures to reduce the memory they require (or to conform to an existing format) by reordering structure members or changing the compiler's alignment (or “packing”) of structure members. struct MixedData /* after reordering */ { char Data1; char Data4; /* reordered */ short Data2; int Data3; }; The compiled size of the structure now matches the pre-compiled size of 8 bytes. Note that has been replaced (and thus eliminated) by and is no longer necessary as the structure is already aligned to the size of a long word. The alternative method of enforcing the structure to be aligned to a one byte boundary will cause the pre-processor to discard the pre-determined alignment of the structure members and thus no padding bytes would be inserted. While there is no standard way of defining the alignment of structure members, some compilers use directives to specify packing inside source files. Here is an example: #pragma pack(push) /* push current alignment to stack */ #pragma pack(1) /* set alignment to 1 byte boundary */ struct MyPackedData { char Data1; long Data2; char Data3; }; #pragma pack(pop) /* restore original alignment from stack */ This structure would have a compiled size of 6 bytes on a 32-bit system. The above directives are available in compilers from Microsoft, Borland, GNU, and many others. Another example: struct MyPackedData { char Data1; long Data2; char Data3; } __attribute__((packed)); Default packing and On some Microsoft compilers, particularly for RISC processors, there is an unexpected relationship between project default packing (the /Zp directive) and the directive. The directive can only be