Structure member Alignment & Padding
Structure and union variable declarations A structure or union declaration has the same form as a definition except the declaration does not have a brace-enclosed list of members. You must declare the structure or union data type before you can define a variable having that type. Read syntax diagramSkip visual syntax diagramStructure or union variable declaration syntax .-----------------------------. V | >>---+-------------------------+-+--+-struct-+------------------> +-storage_class_specifier-+ '-union--' '-type_qualifier----------' >--tag_identifier--declarator--;------------------------------->< Bit Fields Alignment If a series of bit fields does not add up to the size of an int, padding can take place. The amount of padding is determined by the alignment characteristics of the members of the structure. The following example demonstrates padding, and is valid for all implementations. Suppose th...