C++ Programming - Constructors and Destructors - Discussion

Discussion Forum : Constructors and Destructors - General Questions (Q.No. 12)
12.
A union that has no constructor can be initialized with another union of __________ type.
different
same
virtual
class
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
7 comments Page 1 of 1.

Ibm_ki_site_se_maraa said:   1 decade ago
Unions cannot contain class objects that have constructors or destructors.

Priyanka said:   1 decade ago
What is union?

Vmd said:   1 decade ago
@Priyanka. Union is same as structure. But the only difference is union use same memory location for storage and structure uses different.

Shiv said:   1 decade ago
What is same in answer?

Upendra Patel said:   1 decade ago
All the members of the union shares the same memory where as members of structure occupy separate memory.

Akshay said:   10 years ago
In union, memory allocation take places on the basis of the data that required max size in program.

Other data members share that allocated memory while in class every data member allocated at separate memory.

Mitz said:   10 years ago
How union which have no constructor can be initialized by another union of same type?

Post your comments here:

Your comments will be displayed after verification.