C++ Unions and Classes
All Articles

Unions and Classes in C++

C++ also supports unions as in C. They are functionally similar to that of a class but has the following limitations: All members are public by default Cannot be a base class to inherit other classes Cannot have virtual functions Cannot include static variable An object using a constructor and destructor cannot be a member…