Wiki Markup |
---|
The size of a structure is not always equal to the sum of the sizes of its members. According to Section 6.7.2.1 of the C99 standard, "There may be unnamed padding within a structure object, but not at its beginning." \[[ISO/IEC 9899-1999|AA. C References#ISO/IEC 9899-1999]\], |
...
. |
This is often referred to as structure padding. Structure members are arranged in memory as they are declared in the program text. Padding may be added to the structure to ensure the structure is properly aligned in memory.
...