A union allows the same memory location to be used for different data types. The amount of memory that is allocated for the union is determined by its largest member. This saves space, especially for large structures where the programmer can be sure that the same members never occur at the same time.
Unions:
struct is replaced with union.Syntax
union unionName {
type1 memberName1;
...
typen memberNamen;
}
Code example
union mixedPickles {
char c;
int i;
float f;
}