From Appmethod Topics
Jump to: navigation, search

Go Up to Keywords, Alphabetical Listing Index


Type Specifiers


union [<union type name>] {
<type> <variable names> ;
} [<union variables>] ;


Use unions to define variables that share storage space.

The compiler allocates enough storage in a_number to accommodate the largest element in the union.

Unlike a struct, the members of a union occupy the same location in memory. Writing into one overwrites all others.

Use the record selector (.) to access elements of a union .

See Also