關鍵字是保留字。我們不能將其用作變數名稱,常數名稱等。下面給出了C語言中可用的C++語言中的32
個關鍵字列表。
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 |
下面給出了在C語言中不可用的30
個C++語言關鍵字的列表。
asm | dynamic_cast | namespace | reinterpret_cast | bool |
---|---|---|---|---|
explicit | new | static_cast | false | catch |
operator | template | friend | private | class |
this | inline | public | throw | const_cast |
delete | mutable | protected | true | try |
typeid | typename | using | virtual | wchar_t |