C Programming - Structures, Unions, Enums - Discussion

Discussion Forum : Structures, Unions, Enums - Yes / No Questions (Q.No. 8)
8.
Is it necessary that the size of all elements in a union should be same?
Yes
No
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Abhay said:   1 decade ago
Size of all element may not be the same but size of the union is the size of the longest element.

Puneet Kumar Garg said:   1 decade ago
It is not necessary to have same size of all elements in union and structure. Union only allocates memory for largest element and share it for all either they are of same or different size.

Post your comments here:

Your comments will be displayed after verification.