
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
Reserved keywords in C++?
A reserved word is a word that cannot be used as an identifier, such as the name of a variable, function, or label – it is "reserved from use". This is a syntactic definition, and a reserved word may have no meaning.
There are a total of 95 reserved words in C++. The reserved words of C++ may be conveniently placed into several groups. In the first group, we put those that were also present in the C programming language and have been carried over into C++. There are 32 of these.
There are another 30 reserved words that were not in C, are therefore new to C++ programming language.
There are 11 C++ reserved words that are not essential when the standard ASCII character set is being used, but they have been added to provide more readable alternatives for a few of the C++ operators, and also to facilitate programming with character sets that lack characters required by C++.
Here is a list of all these reserved words −
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 |
- Related Articles
- What are Reserved Keywords in Python?
- What are reserved keywords in C#?
- What is the difference between keywords and reserved words in Java?
- HTML reserved Attribute
- Keywords in Python
- Keywords in Java
- Keywords in C#
- What are Reserved Words in Python?
- What are Reserved Words in JavaScript?
- Important Keywords in C#
- C++ Keywords
- Is name a reserved word in MySQL?
- Variables and Keywords in C
- Identifiers and Keywords in Typescript
- char vs string keywords in C#
