#include struct natural_alignment_t { short a; short b; short c; short d; short e; }; #pragma pack(2) struct alignment2_t { short a; short b; short c; short d; short e; }; #pragma pack() #pragma pack(4) struct alignment4_t { short a; short b; short c; short d; short e; }; #pragma pack() #pragma pack(8) struct alignment8_t { short a; short b; short c; short d; short e; }; #pragma pack() #pragma pack(16) struct alignment16_t { short a; short b; short c; short d; short e; }; #pragma pack() #pragma pack(32) struct alignment32_t { short a; short b; short c; short d; short e; }; #pragma pack() int main() { printf( "natural: %ul\n", sizeof( natural_alignment_t ) ); printf( " 2 : %ul\n", sizeof( alignment2_t ) ); printf( " 4 : %ul\n", sizeof( alignment4_t ) ); printf( " 8 : %ul\n", sizeof( alignment8_t ) ); printf( " 16 : %ul\n", sizeof( alignment16_t ) ); printf( " 32 : %ul\n", sizeof( alignment32_t ) ); return 0; }