Differentiate between structure and union?
Both are user defined data types. Structure allocate memory for all its members while union allocates memory for biggest element only. Unions are mainly used to better optimization of structures. Example: without union struct student { int rollo; char name[51]; char course[21]; float fees; }; struct faculty { int empid; char name[51]; char dept[51]; char desig[51]; float salary; }; main() { struct student s; struct faculty f; printf("Memory usage %d",sizeof(s)+sizeof(f)); //244 bytes } Example: with union struct student { int rollo; char name[51]; char course[21]; float fees; }; struct faculty { int empid; char name[51]; ...