Open In App

C++ Keywords

Last Updated : 01 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Keywords are the reserved words that have special meanings in the C++ language. They are the words that have special meaning in the language. C++ uses keywords for a specifying the components of the language, such as void, int, public, etc. They can't be used for a variable name, function name or any other identifiers.

The total number of keywords in C++ are 93 up to C++ 23 specification. Below is the table for all C++ keywords:

alignasalignofandand_eqasm
autobitandbitorboolbreak
casecatchcharchar8_tchar16_t
char32_tclasscomplconceptconst
constevalconstexprconstinitconst_castcontinue
co_awaitco_returnco_yielddecltypedefault
deletedodoubledynamic_castelse
enumexplicitexportexternfalse
finalfloatforfriendgoto
ifinlineintlongmutable
namespacenewnoexceptnotnot_eq
nullptroperatororor_eqprivate
protectedpublicregisterreinterpret_castrequires
returnshortsignedsizeofstatic
static_assertstatic_caststructswitchtemplate
thisthread_localthrowtruetry
typedeftypeidtypenameunionunsigned
usingvirtualvoidvolatilewchar_t
whilexorxor_eq

Note: The number of keywords C++ has evolved over time as new features were added to the language. For example, C++ 98 had 63 keywords, C++ 11 had 84 keywords, C++

Keywords vs Identifiers

So, there are some properties of keywords that distinguish keywords from identifiers. They listed in the below table

Keywords Identifiers
Keywords are predefined/reserved words identifiers are the values used to define different programming items like a variable, integers, structures, and unions.
It defines the type of entity.It classifies the name of the entity.
A keyword contains only alphabetical characters, an identifier can consist of alphabetical characters, digits, and underscores.
It should be lowercase.It can be both upper and lowercase.
No special symbols or punctuations are used in keywords and identifiers. No special symbols or punctuations are used in keywords and identifiers.  The only underscore can be used in an identifier.
Example: int, char, while, do.Example: Geeks_for_Geeks, GFG, Gfg1.

Next Article
Article Tags :
Practice Tags :

Similar Reads