Union is similar to structure in that both have several members but a union can hold value in only one of its members at any time. Members are overlaid in the storage allocation for a union variable. The compiler allocates sufficient storage to accommodate the largest member of a union.
union num { char character; short short_int; float floating; } data;

- Just like struct, we use the . operator to access members of a union variable.
- It’s the programmer’s responsibility to keep track of what data type is currently stored in a union variable.