C ++中的保留关键字?
保留字是不能用作标识符的字,例如变量名、函数名或标签名——它是“禁止使用的保留字”。这是一个语法定义,保留字可能没有任何意义。
在C++中总共有95个保留字。C++的保留字可以方便地放置到多个组中。在第一组中,我们将那些也存在于C编程语言中并已经被移植到C++中。一共有32个。
还有30个不在C中的保留字,因此对于C ++编程语言来说是新的。
使用标准ASCII字符集时,有11C ++保留字不是必需的,但已添加这些保留字以为一些C ++运算符提供更具可读性的替代方式,并且还有助于使用缺少所需字符的字符集进行编程由C ++编写。
这是所有这些保留字的列表-
| alignas (since C++11) | alignof (since C++11) | and |
| and | and_eq | asm |
| atomic_cancel (TM TS) | atomic_commit (TM TS) | atomic_noexcept (TM TS) |
| auto(1) | bitand | bitor |
| bool | break | case |
| catch | char | char16_t (since C++11) |
| char32_t (since C++11) | class(1) | compl |
| concept (since C++20) | const | constexpr (since C++11) |
| const_cast | continue | co_await (coroutines TS) |
| co_return (coroutines TS) | co_yield (coroutines TS) | decltype (since C++11) |
| default(1) | delete(1) | do |
| double | dynamic_cast | else |
| enum | explicit | export(1) |
| extern(1) | false | float |
| for | friend | goto |
| if | import (modules TS) | inline(1) |
| int | long | module (modules TS) |
| mutable(1) | namespace | new |
| noexcept (since C++11) | not | not_eq |
| nullptr (since C++11) | operator | or |
| or_eq | private | protected |
| public | register(2) | reinterpret_cast |
| requires (since C++20) | return | short |
| signed | sizeof(1) | static |
| static_assert (since C++11) | static_cast | struct(1) |
| switch | synchronized (TM TS) | template |
| this | thread_local (since C++11) | throw |
| true | try | typedef |
| typeid | typename | union |
| unsigned | using(1) | virtual |
| void | volatile | wchar_t |
| while | xor | xor_eq |
以上是 C ++中的保留关键字? 的全部内容, 来源链接: utcz.com/z/350130.html

