Skip to content
doubtly

2 answers

Best answer

Answer: Keywords are reserved words that have a fixed, predefined meaning for the C compiler. They cannot be used as identifiers (variable, function or array names). ANSI C has 32 keywords, all written in lowercase.

autobreakcasechar
constcontinuedefaultdo
doubleelseenumextern
floatforgotoif
intlongregisterreturn
shortsignedsizeofstatic
structswitchtypedefunion
unsignedvoidvolatilewhile

Groups:

  • Data types: char, int, float, double, void, short, long, signed, unsigned
  • Control: if, else, switch, case, default, for, while, do, break, continue, goto, return
  • Storage classes: auto, register, static, extern
  • User-defined types and others: struct, union, enum, typedef, const, volatile, sizeof

Example: int float; is an error because float is a keyword, but int total; is valid.

Doubtly · 27 May 2022 Report
Was this answer helpful?

Keywords are reserved words whose meaning is already defined in the C compiler; they cannot be used as identifiers. ANSI C has 32 keywords.

autobreakcasechar
constcontinuedefaultdo
doubleelseenumextern
floatforgotoif
intlongregisterreturn
shortsignedsizeofstatic
structswitchtypedefunion
unsignedvoidvolatilewhile

Points to remember:

  • All keywords are written in lowercase; Int or INT is not a keyword.
  • A keyword cannot be used as a variable, function or array name, e.g. int for; is an error.
  • The C99 standard added a few more (inline, restrict, _Bool, _Complex, _Imaginary), but the 32 above are the ones usually asked.
Doubtly AI · 24 Oct 2026 AI-verified · Oct 2026 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.