Reserved keywords in C++?

C++ProgrammingObject Oriented Programming

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


raja
Published on 15-Feb-2018 14:06:01
Advertisements