Tokens
The smallest individual units in a program are known as tokens.
C++ has following tokens:
Keywords
Identifier
Constants
Strings
Operators
A C++ program is written using these tokens, white space and the syntax of the language.Most of the c++ tokens are basically similar to the c tokens with the exception of some addition and some modifications.
Constants & Identifier
Identifier refer to the names of variables, function, arrays, class etc created by the programmer. They are the fundamental requirements of any languages.Each language has its own rules for naming these identifiers.
The following rules are common to both c & c++.
1. Only alphabetic characters, digits and uppercase are permitted.
2. The name cannot start with digits.
3. Uppercase and lowercase letters are distinct.
4. A declared keyword cannot be used as variable name.
A constant is quantity thar doesn’t change.
Keywords
The keywords implement specific C++ language festures.They are explicitly reserved identifiers and cannot be used as names for the program variables or other user defined program elements.
asm |
auto |
break |
case |
catch |
char |
class |
const |
continue |
default |
delete |
do |
double |
else |
enum |
extern |
float |
for |
friend |
goto |
if |
inline |
int |
long |
new |
opertor |
private |
public |
protected |
register |
return |
short |
signed |
static |
struct |
sizeof |
switch |
this |
throw |
try |
typedef |
void |
volatile |
while |
virtual |
union |
unsigned |
|