C Programming Language Keywords
Data Types
int
- Integer data typechar
- Character data typefloat
- Single-precision floating-pointdouble
- Double-precision floating-pointvoid
- Empty data type/no return value_Bool
- Boolean data type (C99)long
- Long integer data typeshort
- Short integer data typesigned
- Signed modifierunsigned
- Unsigned modifier
Storage Classes
auto
- Automatic storage durationregister
- Register storage classstatic
- Static storage durationextern
- External linkage
Control Flow
if
- Conditional statementelse
- Alternative branch in conditionalswitch
- Multi-way decisioncase
- Label in switch statementdefault
- Default label in switchbreak
- Exit from loop/switchcontinue
- Skip to next iterationreturn
- Return from functiongoto
- Jump to label
Loops
for
- For loopwhile
- While loopdo
- Do-while loop
Type Qualifiers
const
- Constant valuevolatile
- Value may change unexpectedlyrestrict
- Pointer optimization hint (C99)
Structure and Union
struct
- Structure declarationunion
- Union declarationtypedef
- Create type aliasenum
- Enumeration declaration
Size and Alignment
sizeof
- Size of type/variable_Alignas
- Specify alignment (C11)_Alignof
- Query alignment (C11)
Complex Numbers (C99)
_Complex
- Complex number type_Imaginary
- Imaginary number type
Atomic Operations (C11)
_Atomic
- Atomic type specifier
Thread Local Storage (C11)
_Thread_local
- Thread-local storage
Function Specifiers
inline
- Inline function hint (C99)_Noreturn
- Function does not return (C11)
Notes:
- Keywords are case-sensitive
- Cannot be used as identifiers (variable names, function names, etc.)
- Some keywords were introduced in later C standards (C99, C11)
- Different compilers might support additional keywords
Best Practices:
- Always use keywords according to their intended purpose
- Be aware of which C standard your compiler supports
- Some keywords might behave differently across different platforms
- Avoid using names that are too similar to keywords for better code readability
Complete Keywords Reference Table
Keyword | Category | Description | Standard |
---|---|---|---|
auto |
Storage Class | Automatic storage duration | C89 |
break |
Control Flow | Exit from loop/switch | C89 |
case |
Control Flow | Label in switch statement | C89 |
char |
Data Type | Character data type | C89 |
const |
Type Qualifier | Constant value | C89 |
continue |
Control Flow | Skip to next iteration | C89 |
default |
Control Flow | Default label in switch | C89 |
do |
Loop | Do-while loop | C89 |
double |
Data Type | Double-precision floating-point | C89 |
else |
Control Flow | Alternative branch in conditional | C89 |
enum |
Structure | Enumeration declaration | C89 |
extern |
Storage Class | External linkage | C89 |
float |
Data Type | Single-precision floating-point | C89 |
for |
Loop | For loop | C89 |
goto |
Control Flow | Jump to label | C89 |
if |
Control Flow | Conditional statement | C89 |
int |
Data Type | Integer data type | C89 |
long |
Data Type | Long integer data type | C89 |
register |
Storage Class | Register storage class | C89 |
return |
Control Flow | Return from function | C89 |
short |
Data Type | Short integer data type | C89 |
signed |
Data Type | Signed modifier | C89 |
sizeof |
Operator | Size of type/variable | C89 |
static |
Storage Class | Static storage duration | C89 |
struct |
Structure | Structure declaration | C89 |
switch |
Control Flow | Multi-way decision | C89 |
typedef |
Structure | Create type alias | C89 |
union |
Structure | Union declaration | C89 |
unsigned |
Data Type | Unsigned modifier | C89 |
void |
Data Type | Empty data type | C89 |
volatile |
Type Qualifier | Value may change unexpectedly | C89 |
while |
Loop | While loop | C89 |
_Bool |
Data Type | Boolean data type | C99 |
_Complex |
Data Type | Complex number type | C99 |
_Imaginary |
Data Type | Imaginary number type | C99 |
inline |
Function | Inline function hint | C99 |
restrict |
Type Qualifier | Pointer optimization hint | C99 |
_Alignas |
Alignment | Specify alignment | C11 |
_Alignof |
Alignment | Query alignment | C11 |
_Atomic |
Type Qualifier | Atomic type specifier | C11 |
_Noreturn |
Function | Function does not return | C11 |
_Thread_local |
Storage Class | Thread-local storage | C11 |