Topic 10 of 100 Fundamentals of C Interactive Tutorial

C Reserved Keywords: Complete List and Usage Examples

12 mins read Last updated: 22 Aug 2026 21,340 views
C Compiler 0.00%

What is C Reserved Keywords? Core Concept & Direct Summary

Core Objective & Problem Statement

What are the standard reserved keywords in C, and why cannot they be used as identifier names?

Direct Answer Summary

Here's a surprising fact that makes C unique among popular languages:its entire vocabulary fits on an index card.

Python has 35+ keywords. Java has 50+. JavaScript keeps adding more every year. But C? The classic language reserves just32 words— and from those 32 words, programmers have built operating systems, databases, and the software running on Mars rovers.

These reserved words are calledkeywords, and learning them is like learning the pieces in chess. There aren't many, each has a fixed job, and mastery comes from knowingwhento use each one.

In this guide, you'll get the complete list of all 32 keywords — organized by what they actuallydo, with a one-line example for each — plus the newer keywords added by recent standards, and the naming mistakes every beginner must avoid.

How Does C Reserved Keywords Work? In-Depth Mechanics & Architecture

What Is a Keyword in C?

Akeyword(also called areserved word) is a word the C language has claimed for itself. It has one fixed, built-in meaning, and you arenot allowedto use it as a name for your variables, functions, or anything else you create.

main.c
Run Online
int count = 5;
// ✅ fine — "count" is your own name
int while = 5;
// ❌ ERROR — "while" is reserved

Three golden rules about C keywords:

  1. All 32 classic keywords are lowercase.Int,IF, andReturnarenotkeywords — and using them that way is an error.
  2. They're case-sensitive like everything in C.Returnis an identifier;returnis a keyword.
  3. They cannot be redefined.You can't makeformean anything other than what C says it means.

The Complete List of 32 Keywords in C

Rather than dumping 32 words alphabetically, let's group them byjob— that's how your brain will actually remember them.

🟦 Group 1: Data Type Keywords (12)

These declare what kind of data a variable holds:

KeywordMeaningExample
intInteger numbersint age = 25;
charSingle characterschar grade = 'A';
floatDecimal numbers (single precision)float price = 9.99;
doubleDecimal numbers (double precision)double pi = 3.14159;
void"No value / no type"void showMenu() { }
shortSmaller integershort year = 2026;
longLarger integerlong stars = 1000000L;
signedAllows negative values (default)signed char temp = -5;
unsignedNon-negative only, doubles the positive rangeunsigned int count = 0;
_BoolBoolean type (0 or 1)_Bool done = 0;
_ComplexComplex numbersrarely used by beginners
_ImaginaryImaginary numbersrarely used by beginners

Note:_Bool,_Complex, and_Imaginaryarrived with C99 — they're the "new kids," only 25+ years old.

🟩 Group 2: Control Flow Keywords (12)

These controlwhichcode runs andwhen:

KeywordMeaningExample
ifRun code when a condition is trueif (age >= 18)
elseThe alternative pathelse { ... }
switchMulti-way decisionswitch (choice)
caseOne option inside a switchcase 1:
defaultThe "none matched" optiondefault:
forCounted loopfor (int i = 0; i < 5; i++)
whileCondition-based loopwhile (x < 10)
doLoop that runs at least oncedo { ... } while (x);
breakExit a loop or switch instantlybreak;
continueSkip to the next loop iterationcontinue;
gotoJump to a labeled linegoto cleanup;
returnExit a function, optionally with a valuereturn 0;

🟨 Group 3: Storage Class Keywords (4)

These controlwherevariables live andhow longthey survive:

KeywordMeaningExample
autoLocal variable (the default — rarely written)auto int x = 5;
staticSurvives between function calls / limits visibilitystatic int count = 0;
extern"This variable is defined in another file"extern int total;
registerHint to store in a CPU register (mostly historical)register int i;

🟧 Group 4: Type Structure Keywords (4)

These buildnewtypes and change how types behave:

KeywordMeaningExample
structGroup different data into one recordstruct Student { ... };
unionMembers sharing one memory locationunion Data { ... };
enumNamed integer constantsenum Color { RED, GREEN };
typedefCreate an alias for a typetypedef int Score;

🟥 Group 5: The Special Four (4)

KeywordMeaningExample
constValue can't be changed after creationconst int MAX = 100;
volatile"This can change unexpectedly" — hardware, interruptsvolatile int flag;
sizeofReturns the memory size of a type/variablesizeof(int)→ 4
sizeofbonus factit's anoperator, not a function!no function call happens

The Newer Keywords: C11 and C23 Additions

C evolves slowly, but itdoesevolve. Two recent standards expanded the reserved list:

C11 (2011) added:_Alignas,_Alignof,_Atomic,_Generic,_Noreturn,_Static_assert,_Thread_local

Notice the pattern? They start with anunderscore and capital letter— deliberately ugly, so they'd never clash with names real programmers were already using. Clever, if not pretty.

C23 (2023/2024) promoted several words to full keywords:true,false,nullptr,constexpr,static_assert, andtypeof, among others. If you're on a modern compiler,bool-style logic now works without any headers:

main.c
Run Online
// C23 — no #include needed for this!
bool isReady = true;
if (isReady) {
    // ...
}

Keywords vs Identifiers: Know the Difference

This distinction confuses many beginners, so let's nail it down:

main.c
Run Online
int return = 10;
// ❌ ERROR — return is a keyword
int returnValue = 10;
// ✅ fine — returnValue is an identifier
int returns = 10;
// ✅ fine — "returns" is NOT a keyword
int printf = 5;
// ⚠️ legal but terrible — printf is an identifier (library function)

Wait — that last line islegal? Yes.printfisnot a keyword. It's just a function name from the standard library — technically an identifier. Youcanreuse it as a variable name, though you'd shadow the function and confuse everyone reading your code. Legal doesn't mean wise.

Quick self-test:which of these are valid variable names?

main.c
Run Online
int float_num;
// ?
int floatNum;
// ?
int float;
// ?

Answers: ✅float_num(fine), ✅floatNum(fine), ❌float(keyword — error).

Why So Few Keywords Is Actually a Superpower

There's a design lesson hiding in C's tiny vocabulary. Most languages bake featuresintothe language — C pushes them intolibrariesinstead. Printing isn't a keyword; it'sprintf()fromstdio.h. Math isn't keywords; it'ssqrt()andpow()frommath.h.

The result: the core language stays small enough to learn completely, stable enough to last fifty years, and flexible enough to extend infinitely through libraries. When you hear that "C is a small language," this is what it means.

Runnable C Code Example & Practical Implementation

main.c
Run Online
#include <stdio.h>
int main() {
    const double PI = 3.1415926535;
    volatile int sensorReading = 100;
    unsigned int counter = 50;
    printf("PI: %.4f, Sensor: %d, Counter: %u\
", PI, sensorReading, counter);
    return 0;
}

Key Takeaways, Best Practices & Memory Safety Rules

Best Practice & Key Takeaways
Use const for immutable values and volatile for hardware memory-mapped I/O and interrupt service routine (ISR) flags.

Frequently Asked Questions & Technical Interview Insights

Technical Interview & Viva Questions

Frequently asked C programming interview questions
Q

Q: What does the `volatile` keyword instruct the compiler to do?

A: It tells the compiler that the variable's value may change unexpectedly (e.g. by hardware interrupt or concurrent thread), disabling aggressive compiler register caching/optimization for that variable.
Q

Q: How many keywords existed in original ANSI C89?

A: Exactly 32 keywords.

Related Tools, Tutorials & Authoritative References

Recommended Interactive Tools

Authoritative Standards & Citations