Keywords in C

Last Updated : 7 Apr, 2026

Keywords are predefined (reserved) words in C that have special meaning to the compiler.

  • They are part of the language syntax
  • They cannot be used as identifiers (variable, function, or struct names)

List of Keywords in C

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

We cannot use these keywords as identifiers (such as variable names, function names, or struct names). The compiler will throw an error if we try to do so.

Example: The code below demonstrates what happens when we use a keyword as a variable name:

C
#include <stdio.h>

int main() {
    int return = 10;   
    printf("%d\n", return);
    return 0;
}

Output

error: expected identifier before 'return'

Let's categorize all keywords based on context for a more clear understanding.

CategoryKeywords

Data Type Keywords

char, int, float, double, void, short, long, signed, unsigned

Operator & Utility Keywords

sizeof, return, goto, typedef

Control Flow Keywords

if, else, switch, case, default, for, while, do, break, continue

Storage Class Keywordsauto, register, static, extern
Type Qualifiersconst, volatile
User Defined Typesstruct, union, enum

Read about Differences between Keywords and Identifiers in C.

Comment