C Union Kinds

Use “c union” to match all C Union kinds.

Kind Name
C Private Member Union Type
C Protected Member Union Type
C Public Member Union Type
C Union Type
C Unknown Union Type
C Unnamed Private Member Union Type
C Unnamed Protected Member Union Type
C Unnamed Public Member Union Type
C Unnamed Union Type
C Unresolved Private Member Union Type
C Unresolved Protected Member Union Type
C Unresolved Public Member Union Type
C Unresolved Union Type
C Unresolved Unnamed Union Type

A union allows storage of different types of data into the same storage area.

union anyNumber{           // C Union Type
   int i;
   float f;
}; 

A union may be a member of a class. In this case the union may be private, protected, or public.

class A { 
  public: 
    union anyNumber{     // C Public Member Union Type
     int i;
     float f;
    };
} 

A union or member union may be unnamed.

union {                  // C Unnamed Union Type
   int i;
   float f;
} mydata; 

An unresolved union is a union which is known to exist, but who’s definition is unknown. This typically occurs when a header file is not part of the project. An unknown union is a union whose definition and declaration is not found.

#include "my_unions.h" // C Unresolved Header File; 
union my_union data;  // C Unresolved Union Type
         // my_union is defined in unresolved header file 
union unknown_union more_data;  //unknown_union is not
                  // defined and is C Unknown Type 

Scientific Toolworks, Inc.
http://www.scitools.com