inline

Which Are the 32 Keywords in C? Full List

The original C standard defines 32 keywords. See the full list grouped by purpose, plus the words later C versions added, such as inline and restrict.

On this page
  1. The 32 keywords
  2. What the groups mean
  3. Keywords added in later versions of C
  4. How C++ differs
  5. Keywords cannot be used as names

C’s original standard, usually called C89 or ANSI C, defines 32 keywords. A keyword is a reserved word with a fixed meaning, so you cannot use it as the name of a variable, function, or type.

The 32 keywords

Here they are, grouped by what they do:

Group Keywords
Data types char, double, float, int, long, short, signed, unsigned, void
Composite types struct, union, enum
Type qualifiers const, volatile
Storage classes auto, extern, register, static, typedef
Control flow break, case, continue, default, do, else, for, goto, if, return, switch, while
Operator sizeof

In alphabetical order, the list is: auto, break, case, char, const, continue, default, do, double, else, enum, extern, float, for, goto, if, int, long, register, return, short, signed, sizeof, static, struct, switch, typedef, union, unsigned, void, volatile, while.

What the groups mean

Data types set the kind of value a variable holds. The const qualifier tells the compiler that a value should not be modified through that name. volatile tells the compiler that a value may change in ways the program does not control, such as through hardware. Storage classes control how a variable is stored and how long it exists. static has more than one meaning, depending on where it is used, and the file-level meaning is covered under static functions in c. Control-flow keywords steer which code runs. sizeof gives the size, in bytes, of a type or expression.

Keywords added in later versions of C

The list grew as the C standard was revised. C99 added inline, restrict, _Bool, _Complex, and _Imaginary. C11 added _Alignas, _Alignof, _Atomic, _Generic, _Noreturn, _Static_assert, and _Thread_local. Later revisions have added more again, so the total depends on which version of the standard you use. That is why inline is not among the original 32: it arrived with C99.

How C++ differs

C++ has its own, longer list of reserved words, including bool, class, namespace, new, delete, template, and this. Two C keywords behave differently in C++. restrict is not a C++ keyword, although some compilers offer __restrict. And C++17 removed register as a storage class, although the word is still reserved.

Keywords cannot be used as names

The compiler rejects a keyword when you use it as a name:

int for = 3;   /* error: for is a reserved word */

Keywords are case-sensitive, so Int and Return are ordinary names that you can use for variables.

The complete guide to inline

The inline Keyword in C++
Read the guide

Keep exploring

Guides from other topics

All topics →

C++ Header File Example

A complete C++ header file example: a .h file with declarations, a .cpp file with definitions, a main program, and how to compile and run them.

Header Files 3 min read

Class Constructors in C++

Learn C++ class constructors with compilable examples: default and parameterized forms, member initializer lists, explicit, and initialization order.

Constructors 6 min read

Friend Functions in C++

Learn what a friend function is in C++, how the friend keyword lets a non-member function reach private members, and when to use one, with code examples.