The basic advantage is that union will use the memory space of the datatype which has the highest memory …. hence memory consumption will be less…But when u use structure the total memory will be the sum of the memory of all datatypes.. ie. (higher memory allocation)Disadvantage is that…..
What is union in C advantages and disadvantages?
The basic advantage is that union will use the memory space of the datatype which has the highest memory …. hence memory consumption will be less…But when u use structure the total memory will be the sum of the memory of all datatypes.. ie. (higher memory allocation)Disadvantage is that…..