Hi I wanted know the reasons of the following code
void main() { class test { public: test(){} int k; }; class test1 { public:
In C++, unions may not contain classes with (non-trivial) constructors or destructors. This is because the compiler has no means of telling which constructor or destructor to use when a union instance is created or destroyed.