In the C programming language, a union is a datatype. The union may consist of different fields, each with different types. The space taken up by the union is the same as the largest of the individual types (plus padding) - and all the fields within the union have the same address as the union itself. For example
- union {
- int a;
- double b;
- } c;
See also :
Mathematical union - Set theoretic union.