Thread: unions in a class

  1. #1
    O'Conner
    Guest

    unions in a class

    just wondering can i put a union as member data in a class or can i even put a struct
    an example would be say my class was a cook and some of his data included a list of all of the recipies he new as well as his age and all that other junk
    the reason i say union is because only one recipie would have to be obtained at a time
    thanks for any help

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    A union, structure, or class can be used as a member of a class.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Class design problem
    By h3ro in forum C++ Programming
    Replies: 10
    Last Post: 12-19-2008, 09:10 AM
  2. Specializing class
    By Elysia in forum C++ Programming
    Replies: 6
    Last Post: 09-28-2008, 04:30 AM
  3. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 01:03 AM
  4. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM