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)

KeywordDescription
autoDefault storage class for local variables
breakExit from loops or switch
caseDefines a branch in a switch statement
charCharacter data type
constDefines a constant value
continueSkip to next iteration of a loop
defaultDefault branch in switch statement
doDo-while loop
doubleDouble-precision floating-point data type
elseAlternative branch in if-else
enumDefines an enumeration (set of named constants)
externDeclares a variable/function defined elsewhere
floatFloating-point data type
forFor loop
gotoJump to a labeled statement
ifConditional statement
inlineSuggests compiler to inline a function
intInteger data type
longLong integer data type
registerSuggests storing variable in CPU register
restrictPointer optimization hint (C99)
returnExit from a function and return a value
shortShort integer data type
signedSigned integer
sizeofReturns size of a type or variable in bytes
staticPreserves variable value between function calls; file-level scope
structDefines a structure
switchSwitch-case control statement
typedefDefines a new type name
unionDefines a union
unsignedUnsigned integer
voidFunction returns nothing or empty pointer type
volatileTells compiler variable can change unexpectedly
whileWhile loop
_BoolBoolean type (C99)
_ComplexComplex number type (C99)
_ImaginaryImaginary 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

CategoryKeywords
Data Typesint, char, float, double, void, short, long, signed, unsigned, _Bool, _Complex, _Imaginary
Control Flowif, else, switch, case, default, for, while, do, break, continue, goto, return
Storage Classesauto, register, static, extern, typedef, volatile, const
Derived Typesstruct, union, enum
Operators/Othersizeof, inline, restrict

You may also like...