Sunday, April 27, 2008

Unions in C++

  1. Default access to a union is public, it can contain member functions and member data
  2. It can’t have a static data members or a member of reference type.
  3. It cannot have virtual functions
  4. it cannot be used as base class nor it can have base class
  5. An object of a class with a construct or a destructor or a user-defined assignment operator cannot be a member of a union [from openasthra]

No comments:

Post a Comment