C Keywords Reference

C Keywords Reference

C keywords are reserved 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-sensitive – Int ≠ int.

  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

#include <stdio.h>

int main() {
const int max = 10; // const keyword
int i;

for(i = 0; i < max; i++) { // for keyword
if(i % 2 == 0) { // if keyword
continue; // continue keyword
}
printf("%d\n", i);
}

return 0; // return keyword
}


✅ 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

CodeCapsule

Sanjit Sinha — Web Developer | PHP • Laravel • CodeIgniter • MySQL • Bootstrap Founder, CodeCapsule — Student projects & practical coding guides. Email: info@codecapsule.in • Website: CodeCapsule.in

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *