关键字
关键字 是语言保留供特殊使用的标识。 虽然可以将它们用于预处理器宏名称,但它被认为是较差的编程样式。 仅保留关键字的精确拼写。 例如, auto 是保留的,但 AUTO 不是保留的。
C 和 C++ 语言的关键字
int
long register return short signed sizeof static |
struct
switch typedef union unsigned void volatile while |
||
备注信息:
|
|||

仅适用于 C 语言的关键字


仅适用于 C++ 语言的关键字
C++ 语言还保留以下关键字:
bool
catch class const_cast 集群 delete |
dynamic_cast
decltype 显式 export false friend inline mutable 名称空间 |
新的
nullptr 操作程序 private protected public re判读 static_assert static_cast 模板 |
此
throw true 尝试 typeid typename 使用 virtual wchar_t |

语言扩展 (IBM 扩展) 的关键字
除了标准语言关键字外, XL C/C++ 编译器还保留以下关键字以在语言扩展中使用:
备注信息:
|
||
XL C/C++ 编译器保留以下关键字作为语言扩展,以实现与 C99 的兼容性。注意:
|

在描述每个关键字的部分中提供了有关扩展关键字有效的编译上下文的更详细信息。
在 C++11 中,关键字 

