Structure Union Each member is assigned its own unique storage area. All members share the same storage area. Total memory required by all members is allocated. Maximum memory required by the member is allocated. All members are active at a time. Only one member is active at a time. All members can be initialized. Only the first member can be initialized. Requires more memory. Requires less memory. Example: struct SS { int a; float b; char c; }; Total bytes = 1 + 2 + 4 = 7 bytes. Example: union SS { int a; float b; char c; }; 4 bytes will be occupied.
struct SS { int a; float b; char c; };
union SS { int a; float b; char c; };