The keywords of the C language are predefined identifiers with special meanings by the compiler, and cannot be used as custom identifiers such as variable names or function names.
1. Data Type Keywords
Used to declare the type of variables, functions, or other data structures.
| Keyword |
Description |
<span>void</span> |
Indicates no type (used for function return values or null pointers) |
<span>char</span> |
Character type (1 byte) |
<span>short</span> |
Short integer type (usually 2 bytes) |
<span>int</span> |
Integer type (usually 4 bytes) |
<span>long</span> |
Long integer type (usually 4 or 8 bytes) |
<span>float</span> |
Single precision floating point type (4 bytes) |
<span>double</span> |
Double precision floating point type (8 bytes) |
<span>signed</span> |
Signed type (default, can be omitted) |
<span>unsigned</span> |
Unsigned type (only represents non-negative numbers) |
2. Control Statement Keywords
Used for program flow control (branching, looping, jumping, etc.)
| Keyword |
Description |
<span>if</span> |
Conditional judgment |
<span>else</span> |
Branch paired with<span>if</span>statement |
<span>switch</span> |
Multi-branch selection |
<span>case</span> |
<span>switch</span> branch label |
<span>default</span> |
<span>switch</span> default branch |
2. Loop Structures
| Keyword |
Description |
<span>for</span> |
Loop statement (suitable for known iterations) |
<span>do</span> |
Loop statement (executes at least once) |
<span>while</span> |
Loop statement (suitable for unknown iterations) |
3. Jump Statements
| Keyword |
Description |
<span>break</span> |
Exit the current loop or<span>switch. That is, the loop ends.</span> |
<span>continue</span> |
Skip the remaining part of the current loop and directly enter the next iteration |
<span>goto</span> |
Unconditional jump to a specified label |
<span>return</span> |
Return value from a function |
3. Storage Class Keywords
Used to control the storage method and lifecycle of variables.
| Keyword |
Description |
<span>static</span> |
Static variable (extends lifecycle or limits scope) |
<span>register</span> |
Register variable |
<span>extern</span> |
Declare external variables or functions (cross-file access) |
<span>typedef</span> |
Define an alias for a type (e.g.,<span>typedef int INT;</span>) |
4. Type Modifiers and Qualifiers
Used to modify the properties of variables.
| Keyword |
Description |
<span>const</span> |
Declare a constant (value cannot be modified) |
<span>volatile</span> |
Declare a volatile variable (prevents compiler optimization, do not cache) |
5. Other Keywords
| Keyword |
Description |
<span>sizeof</span> |
Calculate the byte size of a data type or variable |
<span>inline</span> |
Inline function (suggests the compiler embed the code to optimize performance) |
<span>enum</span> |
Enumeration type (defines a set of named constants) |
Note: All C language keywords are in lowercase; uppercase forms (e.g.,<span>Int</span>) can be used as custom identifiers._Alignas, _Alignof, _Atomic, _Bool, _Complex, _Generic, _Imaginary, _Noreturn, _Static_assert, _Thread_local (these are keywords introduced in C11 and later versions to support more complex programming patterns and features).