Re: C++ programmers! How do you use your 'union's ?

Discussion in 'C++' started by Thomas Matthews, Aug 15, 2003.

  1. Razmig K wrote:
    > Dear mates,
    >
    > This is an another survey for the common (and uncommon) nontrivial
    > uses of the aforementioned C++ construct.
    > It's posted by the same average C++ programmer who's made a similar
    > survey about the uses of 'enum's.
    >
    > I know that space optimization is the key idea behind 'union's, and in
    > most cases a type-field is necessary to verify the type of the entity
    > in the 'union' variable.
    >
    > I'm just curious about how my elder colleagues utilize this inherited
    > feature from C in in their C++ implementations based on diverse
    > programming styles in diverse application domains.
    >
    > Thank you for your interest.
    >
    > Best regards,
    > //rk


    I don't use unions.
    I use parent and child classes.

    --
    Thomas Matthews

    C++ newsgroup welcome message:
    http://www.slack.net/~shiva/welcome.txt
    C++ Faq: http://www.parashift.com/c -faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.learn.c-c++ faq:
    http://www.raos.demon.uk/acllc-c /faq.html
    Other sites:
    http://www.josuttis.com -- C++ STL Library book
     
    Thomas Matthews, Aug 15, 2003
    #1
    1. Advertising

  2. On Fri, 15 Aug 2003 17:32:08 GMT, Thomas Matthews
    <> wrote:

    >I don't use unions.
    >I use parent and child classes.


    Unions and inheritance solve very different problems.
     
    Dave Rahardja, Aug 17, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Razmig K
    Replies:
    5
    Views:
    445
    Boris Kolpackov
    Aug 11, 2003
  2. Noah Roberts
    Replies:
    3
    Views:
    343
    Ron Natalie
    Aug 18, 2003
  3. Samuele Armondi
    Replies:
    3
    Views:
    917
    Samuele Armondi
    Aug 15, 2003
  4. Razmig K

    C programmers! How do you use your 'enum's ?

    Razmig K, Aug 7, 2003, in forum: C Programming
    Replies:
    8
    Views:
    421
    Ben Pfaff
    Aug 9, 2003
  5. Razmig K

    C programmers! How do you use your 'union's ?

    Razmig K, Aug 15, 2003, in forum: C Programming
    Replies:
    15
    Views:
    780
Loading...

Share This Page