- 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
- C++ Advanced
- C++ Files and Streams
- C++ Exception Handling
- C++ Dynamic Memory
- C++ Namespaces
- C++ Templates
- C++ Preprocessor
- C++ Signal Handling
- C++ Multithreading
- C++ Web Programming
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|
|atomic_cancel (TM TS)||atomic_commit (TM TS)||atomic_noexcept (TM TS)|
|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)|
|if||import (modules TS)||inline(1)|
|int||long||module (modules TS)|
|noexcept (since C++11)||not||not_eq|
|nullptr (since C++11)||operator||or|
|requires (since C++20)||return||short|
|static_assert (since C++11)||static_cast||struct(1)|
|switch||synchronized (TM TS)||template|
|this||thread_local (since C++11)||throw|
- 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?
- 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#