C Keywords Reference

C Tutorial

C Keywords Reference

In C Keywords Reference are reserve words that have special meaning in the C language. You cannot use them as variable names, function names, or identifiers. They form the core syntax of C.


 List of C Keywords (C99 Standard)

Keyword Description
auto Default storage class for local variables
break Exit from loops or switch
case Defines a branch in a switch statement
char Character data type
const Defines a constant value
continue Skip to next iteration of a loop
default Default branch in switch statement
do Do-while loop
double Double-precision floating-point data type
else Alternative branch in if-else
enum Defines an enumeration (set of named constants)
extern Declares a variable/function defined elsewhere
float Floating-point data type
for For loop
goto Jump to a labeled statement
if Conditional statement
inline Suggests compiler to inline a function
int Integer data type
long Long integer data type
register Suggests storing variable in CPU register
restrict Pointer optimization hint (C99)
return Exit from a function and return a value
short Short integer data type
signed Signed integer
sizeof Returns size of a type or variable in bytes
static Preserves variable value between function calls; file-level scope
struct Defines a structure
switch Switch-case control statement
typedef Defines a new type name
union Defines a union
unsigned Unsigned integer
void Function returns nothing or empty pointer type
volatile Tells compiler variable can change unexpectedly
while While loop
_Bool Boolean type (C99)
_Complex Complex number type (C99)
_Imaginary Imaginary number type (C99)

 Tips about Keywords

  1. Case-sensitiveIntint.

  2. Cannot use as identifiers – variables, functions, structs.

  3. Reserved for future standards – new C versions may add keywords.

  4. Some keywords are rarely used in basic programs: restrict, _Complex, _Imaginary.


 Example Usage of Some Keywords


 


 Summary Table by Category

Category Keywords
Data Types int, char, float, double, void, short, long, signed, unsigned, _Bool, _Complex, _Imaginary
Control Flow if, else, switch, case, default, for, while, do, break, continue, goto, return
Storage Classes auto, register, static, extern, typedef, volatile, const
Derived Types struct, union, enum
Operators/Other sizeof, inline, restrict

You may also like...