The keyword struct is used to define a structure. |
The keyword union is used to define a union. |
When a variable is associated with a structure the compiler allocates the memory for each member. |
When a variable is associated with a union, the compiler allocates the memory by considering
the size of the largest member. So size of union is equal to the size of largest member. |
The size of structure is greater than or equal to sum of size of its members may end with unused slack bytes. |
Memory allocated is shared by individual members of union. |
Each member within a structure is assigned unique storage area. |
The address is same for all the members of a union indicates that every members of union. |