Keywords
Keywords in C++ are the tokens that are the reserved words in programming languages that have their specific meaning and functionalities within a program. Keywords cannot be used as an identifier to name any variables.
For example, a variable or function cannot be named as ‘int’ because it is reserved for declaring integer data type.
There are 95 keywords reserved in C++. Some of the main Keywords are:
break | try | catch | char | class | const | continue |
default | delete | auto | else | friend | for | float |
long | new | operator | private | protected | public | return |
short | sizeof | static | this | typedef | enum | throw |
mutable | struct | case | register | switch | and | or |
namespace | static_cast | goto | not | xor | bool | do |
double | int | unsigned | void | virtual | union | while |
C++ Tokens
In C++, tokens can be defined as the smallest building block of C++ programs that the compiler understands. Every word in a C++ source code can be considered a token.