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



C++11 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.

C++11 End of C++11 only.

C++ Beginning of C++ only.

The C++ language also reserves the following keywords:

Table2.C++ keywords



C++0x constexpr, nullptr, decltype and static_assert are four keywords in the C++11 standard.

C++ End of C++ only.