C++ Programming Tutorial
Reserved Words or Keywords in C++.
These words have special meaning for C++ Compiler, hence they are called Keyword or Reserve Words. Each Reserve Word has its own special meaning and every Reserve Word is used only to accomplish a particular task in a particular situation. We cannot use a Reserve Word as a common identifier.
A list of 32 Keywords in C++ Language which are also available in C language is given below.
auto |
break |
case |
char |
const |
continue |
default |
do |
double |
else |
enum |
extern |
float |
for |
goto |
if |
int |
long |
register |
return |
short |
signed |
sizeof |
static |
struct |
switch |
typedef |
union |
unsigned |
void |
volatile |
while |
A list of 30 Keywords in C++ Language which are not available in C language is given below.
asm |
dynamic_cast |
namespace |
reinterpret_cast |
bool |
explicit |
new |
static_cast |
false |
catch |
operator |
template |
friend |
private |
class |
this |
inline |
public |
throw |
const_cast |
delete |
mutable |
protected |
true |
try |
typeid |
typename |
using |
virtual |
wchar_t |
C++ Keywords | Description |
---|---|
asm |
Used to write assembly language. |
auto |
Storage is a type of class. Which is also used for Local variables? |
bool |
The Boolean variable is used to declare. For eg. True or False. |
break |
Used to break loops or statements. |
case |
The switch case statement is to be used. |
catch |
Used to handle exceptions from the throw. |
char |
The character variable is used to declare. |
class |
Used to declare classes. |
const |
Const This is used for a constant variable. |
const_cast |
The Constant variable is cast. |
continue |
The loop is iterated. |
default |
The switch is used in case statements. |
delete |
Used for dynamic memory allocation. |
do |
Is a loop type. With which, while loop is used. |
double |
The floating-point is the data-type. |
dynamic_cast |
Used with the pointer. |
else |
The statement with if is used. |
enum |
Enumeration is the 'Keyword' of the data type. |
explicit |
Constructor is used to convert. |
export |
The definition of the template is exported. |
extern |
Storage is a type of class. Whose scope is global? |
false |
Boolean has a value. |
float |
The floating-point variable is used to declare. |
for |
Is a type of loop? |
friend |
Non-member function; Used to access private data. |
goto |
There is a statement that contains a label. |
if |
Is a statement. Which shows whether the condition is true or false? |
inline |
Is used for the function. |
int |
The integer variable is used to declare. |
long |
The long integer variable is used to declare. |
mutable |
Is the type of storage class? |
namespace |
The same identifiers (variables, functions, classes) are used to tell differently. |
new |
Used for dynamic memory allocation. |
operator |
Used to declare overloaded operators. |
private |
Used to declare private members of a class. |
protected |
Used to declare protected members of the class. |
public |
Used to declare public members of the class. |
register |
Is the type of storage class. |
reinterpret_cast |
The cast-type Variable is used to change. |
return |
Is used for the function. |
short |
The short integer variable is used to declare. |
signed |
Is a variable modifier. |
sizeof |
The size of the variable is used to return. |
static |
Is the type of storage class? |
static_cast |
Is a type conversion. |
struct |
The structure is used to define or declare. |
switch |
Is a statement. |
template |
Used to write the Generic Program. |
this |
Brings the pointer to the current object. |
throw |
The exception is used for handling. |
true |
Boolean has value. |
try |
The exception is used for handling. |
typedef |
The data type is used to give alias name. |
typeid |
The object is described. |
typename |
The alternative to the class is. |
union |
This keyword is assigned to its members at the same memory location. |
unsigned |
The unsigned integer variable is used to declare. |
using |
Used with a namespace. |
virtual |
Runtime is used for polymorphism. |
void |
It does not return anything. |