Multiple choice

Choose the correct option among the following.

  1. Structure and union are same.

  2. Structure occupies more space then union.

  3. Union occupies more space then structure.

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A structure allocates separate memory for every member, whereas a union shares the same memory space for all members. Consequently, a structure's size is the sum of its members (plus padding), while a union's size is only that of its largest member.