Next: , Previous: , Up: Basic C Types and Functions   [Contents][Index]


65.1.5 The union form

Unions in general are mutually exclusive variants of data types which are united into a super-type. More formally, the data in a union is a component projection of a product of many types. Informally, the union is a choice of one datum and (with it) one type at a time out of many ones. Unions are arranged by named slots of different types. The slots are accessed by their names.

The syntax for this type-modification is the form:

'(union name
  (slot-name1 type1)
  …
  (slot-namen typen))