In C programming, what keyword is used to declare a union?

The story behind the answer

In C programming, the keyword used to declare a union is `union`.

A union is a user-defined type whose members share the same memory storage. A declaration such as `union Value { int number; float amount; };` introduces a union type with alternative members. Unlike a structure, which stores all members separately, a union is intended to hold one member’s value at a time.

The keyword is part of C’s type syntax, alongside `struct`, `enum`, and `typedef`. `struct` defines a type whose fields occupy distinct portions of memory; `enum` names a set of integer constants; and `typedef` creates an alias rather than a new storage layout. Those distinctions make the wrong options plausible but incorrect here.

Programmers often pair a union with an enum, known as a tagged union, to record which member is currently active. A `typedef` can then give the union a shorter name, but it does not declare the union itself. The declaration keyword remains `union`.

Source: Wikipedia · fact-checked Sept. 2026

Add question to a list

Choose a list to keep this question in: