Post

32C Words

C has 32 keywords

32C Words

C has 32 keywords (in standard C89/C90). These are reserved words — you cannot use them as identifiers (like variable names, function names). Each has a special meaning.


The 32 Keywords in C

I have grouped them for easier revision.


1. Data Type Keywords

  • int → Integer type (e.g., int a = 10;)
  • char → Character type (1 byte, e.g., char c = 'A';)
  • float → Single-precision floating point (e.g., float x = 3.14;)
  • double → Double-precision floating point (e.g., double y = 3.14159;)
  • void → No value / no type (e.g., void func(void);)

2. Type Modifiers

  • short → Smaller range integer (short int a;)
  • long → Larger range integer (long int b;)
  • signed → Can store negative + positive (default for int)
  • unsigned → Only positive values (e.g., unsigned int c;)

3. Storage Class Specifiers

  • auto → Default storage for local variables (rarely used explicitly).
  • static → Variable keeps its value between function calls.
  • extern → Refers to a variable defined elsewhere (used for global sharing).
  • register → Suggests storing variable in CPU register for speed.

4. Control Flow Statements

  • if → Executes block if condition true.
  • else → Executes alternative block if condition false.
  • switch → Multi-way branch (like multiple if-else).
  • case → Label inside switch.
  • default → Fallback label in switch if no case matches.
  • for → Loop with init, condition, increment.
  • while → Loop with condition checked before.
  • do → Loop with condition checked after (runs at least once).
  • break → Exit from loop/switch immediately.
  • continue → Skip rest of loop body, go to next iteration.
  • goto → Jumps to a labeled statement (not recommended, but valid).
  • return → Exit function and optionally return a value.

5. Special Data/Qualifiers

  • const → Variable cannot be modified after initialization.
  • volatile → Value may change anytime outside program control (e.g., hardware registers).
  • enum → User-defined integer constants grouped (e.g., enum Color {RED, GREEN, BLUE};).
  • struct → Group of different data types under one name.
  • union → Memory shared by all members, only one active at a time.
  • typedef → Creates alias for a data type (e.g., typedef unsigned int u32;).

Quick Recap (all 32 at once)

1
2
3
4
5
6
7
8
auto       double     int        struct
break      else       long       switch
case       enum       register   typedef
char       extern     return     union
const      float      short      unsigned
continue   for        signed     void
default    goto       sizeof     volatile
do         if         static     while

Tip for interviews:

  • Group them like I showed (easy to remember).
  • If asked to explain differences (e.g., struct vs union, static vs extern), always give memory and scope points.

This post is licensed under CC BY 4.0 by the author.