|
- Union allocates the memory equal to the maximum memory required by the member of the union but structure allocates the memory equal to the total memory required by the members.
- In union, one block is used by all the member of the union but in case of structure, each member has their own memory space.
- Union is best in the environment where memory is less as it shares the memory allocated.
- But structure cannot implement in shared memory.
- As memory is shared, ambiguity is more in union, but less in structure.
- Self referential union cannot be implemented in any data structure, but self referential structure can be implemented.
|