Keywords
Keywords are identifiers reserved by the language for special use. Although you can use
them for preprocessor macro names, it is considered poor programming style. Only the exact spelling
of keywords is reserved. For example, auto is reserved but AUTO is
not.
Table1.C and C++ keywords
|
auto
break case char const continue default do |
double
else enum extern float for goto if |
int
long register return short signed sizeof static |
struct
switch typedef union unsigned void volatile while |
Beginning of C++11 only.
In C++11, the keyword auto is no longer used as a storage class specifier.
Instead, it is used as a type specifier, which can deduce the type of an auto
variable from the type of its initializer expression.
The keyword extern was previously used as a storage specifier or as part of a
linkage specification. The C++11 standard adds a third usage to use this keyword to specify explicit
instantiation declarations.
End of C++11 only.
Beginning of C++ only.
The C++ language also reserves the following keywords:
Table2.C++ keywords
|
asm
bool catch class const_cast constexpr delete dynamic_cast explicit |
export
decltype false friend inline mutable namespace new nullptr |
operator
private protected public reinterpret_cast static_assert static_cast template |
this
throw true try typeid typename using virtual wchar_t |
constexpr, nullptr, decltype and
static_assert are four keywords in the C++11 standard.
End of C++ only.