以下为 C++ 中的保留字(关键字)。这些保留字不能作为常量名、变量名或其他标识符名称。
| asm | else | new | this |
| auto | enum | operator | throw |
| bool | explicit | private | true |
| break | export | protected | try |
| case | extern | public | typedef |
| catch | false | register | typeid |
| char | float | reinterpret_cast | typename |
| class | for | return | union |
| const | friend | short | unsigned |
| const_cast | goto | signed | using |
| continue | if | sizeof | virtual |
| default | inline | static | void |
| delete | int | static_cast | volatile |
| do | long | struct | wchar_t |
| double | mutable | switch | while |
| dynamic_cast | namespace | template |
下面列出了最常用的三字符序列:
| 三字符组 | 替换 |
|---|---|
| ??= | # |
| ??/ | \ |
| ??' | ^ |
| ??( | [ |
| ??) | ] |
| ??! | | |
| ??< | { |
| ??> | } |
| ??- | ~ |

这篇博客详细列举了C++编程语言中的所有保留字,包括`asm`、`else`、`new`等,并介绍了常用的三字符序列如`??=`、`??/`等,帮助开发者理解这些特殊符号在C++中的用途和限制,提升编程能力。
9427

被折叠的 条评论
为什么被折叠?



