•  Back 
  •  C Language 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : C-Language Documentation
Author      : John Kormylo
Version     : C.HYP 1.0
Subject     : Documentation/C-Language
Nodes       : 233
Index Size  : 6362
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : en
@default    : 
@help       : Help
@options    : +g -i -s +x +z -t4
@width      : 75
View Ref-File[ union ]

Defines a new data type, 'union <name>'.  Syntax:

  union <name> {
    <type> <member>;
    <type> <member>;
    ...
   };

where <name> is the new union name,
<type> is a data type, and
<member> is member name.

One can now define union variables using

  [<qualifier>] [<class>] union <name> <variable> [= <constant> ]
    [, ...] ;

where <qualifier> is a type qualifier,
<class> is a storage class,
<variable> is a new union variable name,
and <constant> is a constant of the same type as the first member.

One can combine a union definition an variable definition into one
statement (in which case <name> is optional).  One can similarly
combine a union definition and a typedef statement.

See also Names, Unions and Variables.