Thursday, 5 November 2015

Difference between Structure and Union?

STRUCTURE UNION 1.The keyword  struct is used to define a structure 1. The keyword union is used to define a union. 2. When a variable is associated with a structure, the compiler allocates the memory for each member. The size of structure is greater than or equal to the sum of sizes of its members. The smaller members may end with unused slack bytes. 2. When a variable...