difference b/w structure and union.
Structure:
1. It allocates memory equal to sum of memory allocated to its each individual member.
2.each member have their own memory space.
3. structure can not be implemented in shred memory.
4. it has less Ambiguity.
5. Self referential structure can be implemented in data structure.
6. All members if structure can be accessed at a time.
Union:
1.It allocates piece of memory that is Large enough to hold the Largest variable of type in union.
2. one block is used by all the members of union.
3. Union is the Best environment where memory is shared.
4. as memory is shared, Ambiguity is more in union.
5. self ref. union can not be implemented.
6. only one member is accessed at a time.
Structure:
1. It allocates memory equal to sum of memory allocated to its each individual member.
2.each member have their own memory space.
3. structure can not be implemented in shred memory.
4. it has less Ambiguity.
5. Self referential structure can be implemented in data structure.
6. All members if structure can be accessed at a time.
Union:
1.It allocates piece of memory that is Large enough to hold the Largest variable of type in union.
2. one block is used by all the members of union.
3. Union is the Best environment where memory is shared.
4. as memory is shared, Ambiguity is more in union.
5. self ref. union can not be implemented.
6. only one member is accessed at a time.