+1 vote
609 views
in OTHER by Expert (3.8k points)
i want to know the Exact difference between UNION and Structure in C with a example?

1 Answer

+2 votes
by Expert (5.1k points)

The difference between structure and union in c are:  

1 :  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.

2:  In union, one block is used by all the member 
of the union but in case of structure, each member have 
their own memory space..

 

HOPE YOU GOT THE POINT! 

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated