When the size of a structure is same as a size of union?
Answers
Answered by
0
Answer:
The total memory required to store a structure variable is equal to the sum of size of all the members. In above case 7 bytes (2+1+4) will be required to store structure variable s1. In union, the total memory space allocated is equal to the member with largest size. All other members share the same memory space.
Answered by
0
Answer:
The total memory required to store a structure variable is equal to the sum of size of all the members. In above case 7 bytes (2+1+4) will be required to store structure variable s1. In union, the total memory space allocated is equal to the member with largest size. All other members share the same memory space.
Similar questions