C++教程-C++的关键字
关键字是保留字。您不能将其用作变量名、常量名等。下面是C++语言中的32个关键字列表,这些关键字也适用于C语言。
| 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 |