Structure and union type definition

A structure or union type definition contains the struct or union keyword followed by an optional identifier (the structure tag) and a brace-enclosed list of members.

Read syntax diagramSkip visual syntax diagramStructure or union type definition syntax
 
>>-+-struct-+--------------------------------------------------->
   '-union--'
 
                          .-----------------------.
                          V                       |
>--+----------------+--{----member_declaration--;-+--}--;------><
   '-tag_identifier-'
 

The tag_identifier gives a name to the type. If you do not provide a tag name, you must put all variable definitions that refer to the type within the declaration of the type, as described in Structure and union type and variable definitions in a single statement. Similarly, you cannot use a type qualifier with a structure or union definition; type qualifiers placed in front of the struct or union keyword can only apply to variables that are declared within the type definition.

Related information



[ Top of Page | Previous Page | Next Page | Contents | Index ]