Unions
Unions are used as variables, when it’s convenient to have the same variable hold different types of data
In effect a union is a struct, in which all members have offset zero. The union is big enough to hold the largest member.It holds one member at a time.
Example:union int_or_float{ int ival; float fval;}union int_or_float x;x.ival = 9; /* x as int */x.fval = 4.321; /* x as float */ /* overwrites int */