Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - unions _ http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                                  Unions                              _
   A  union  is  a structure-like type which  can  contain  variables  of
   different types and sizes at different times. In effect, a union is  a
   structure  which can only contain one member variable at a  time.  The
   size  of a union is the size of its largest member. All of the  member
   variables can be considered to have the same offset within the  union.
   The  union can contain any of its member objects, but only one may  be
   contained by it at any one time.

   A union is defined in the same way as a struct except that the keyword
   union is used.

   It is not possible to derive a class from a union. Also, an object  of
   a  class  with  a constructor or destructor CANNOT be a  member  of  a
   union.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson