A reserved word is a word that cannot be used as an identifier, such as the name of a variable, function, or label – it is "reserved from use". This is a syntactic definition, and a reserved word may have no meaning.
There are a total of 95 reserved words in C++. The reserved words of C++ may be conveniently placed into several groups. In the first group, we put those that were also present in the C programming language and have been carried over into C++. There are 32 of these.
There are another 30 reserved words that were not in C, are therefore new to C++ programming language.
There are 11 C++ reserved words that are not essential when the standard ASCII character set is being used, but they have been added to provide more readable alternatives for a few of the C++ operators, and also to facilitate programming with character sets that lack characters required by C++.
Here is a list of all these reserved words −
|alignas (since C++11)||alignof (since C++11)||and|
|atomic_cancel (TM TS)||atomic_commit (TM TS)||atomic_noexcept (TM TS)|
|catch||char||char16_t (since C++11)|
|char32_t (since C++11)||class(1)||compl|
|concept (since C++20)||const||constexpr (since C++11)|
|const_cast||continue||co_await (coroutines TS)|
|co_return (coroutines TS)||co_yield (coroutines TS)||decltype (since C++11)|
|if||import (modules TS)||inline(1)|
|int||long||module (modules TS)|
|noexcept (since C++11)||not||not_eq|
|nullptr (since C++11)||operator||or|
|requires (since C++20)||return||short|
|static_assert (since C++11)||static_cast||struct(1)|
|switch||synchronized (TM TS)||template|
|this||thread_local (since C++11)||throw|