e-con Systems Interview Question

Difference between struct and union

Interview Answers

Anonymous

May 10, 2026

structure is a collection of variables (members) of possibly different data types, where each member has its own separate memory location. A union is also a collection of variables, but all members share the same memory location.

1

Anonymous

May 20, 2026

Structure allocates seperate memory to all the members and usages more memory so all stores values at a time while Union allocates shared memory to all members so only one member can hold values at time and usages less memory