HP C A.06.05 Reference Manual
Data Types and Declarations
Structure and Union Specifiers
Chapter 348
Structure and Union Specifiers
A structure specifier indicates an aggregate type consisting of a sequence of named members.
A union specifier defines a type whose members begin at offset zero from the beginning of the
union.
Syntax
struct-or-union specifier
::=
struct-or-union [identifier] { struct-declaration-list }
struct-or-union identifier
struct-or-union
::=
struct
union
struct-declaration-list
::=
struct-declaration
struct-declaration-list struct-declaration
struct-declaration
::=
specifier-qualifier-list struct-declarator-list
;
specifier-qualifier-list
::=
type-specifier [specifier-qualifier-list]
type-qualifier [specifier-qualifier-list]
struct-declarator-list
::=
struct-declarator
struct-declarator-list struct-declarator
struct-declarator
::=
declarator
[declarator] : constant-expression
Description
A structure is a named collection of members. Each member belongs to a name space
associated with the structure. Members in different structures can have the same names but
represent different objects.