Character Sets and Tokens in C++

Character Sets and Tokens In C++
Character Sets and Tokens In C++

Character Sets and Tokens in C++

Character Sets:

Character sets are defined as the words, digits, alphabets, symbols or any operators that are valid while writing programs in any programming language (like C++, Python, java etc).

There are four types of character sets in c++. They are as follows:

S.N
Type
Character included
1.
Letter
Lower case a-z
Upper case A-Z
2.
Digits
All the digits from 0-9
3.
Special Symbols/Characters
 , . : ; ? ‘ ” ! | / ~ _$ % # & ^ * – + < > ( ) {  } [ ]
4.
White Spaces
Blank space, Horizontal tab, Carriage return, new line, Form feed


Tokens in C++:

Tokens are defined as the building blocks or smallest unit or basic elements of C++ program. Each words and punctuation are referred as tokens in c++ programming language. 

Following are the Tokens available in C++ programming language.
Identifiers are the names given to the different entities of the program such as functions, variables, constant, classes, structures, etc. Since identifiers refers to a particular entity of a program so it must be unique for every entities.
Rules for making Identifiers:
Keywords can be referred as the reserved words or predefined words that carry some fixed meaning and task in our program. They can neither be modified nor can be used as Identifiers in program. We need not to define keywords, their meaning and task is already known to the compiler. 
To see list of Keywords in C++ visit here.
  • Operators:
Operators are the special symbols (commonly mathematical symbols) that perform certain mathematical and logical operations inside our program. Their number and task is also predefined to the compiler. However, OOPs supports operator overloading.
  • Literals/Constants:
Literals/constants are the entities whose value is fixed throughout the program. There are several types of literal in C++. 

For more on literals/constants visit here.
  • Strings:
Strings are the entities that refers to the sequence of character.
eg. “Hello world”, “KRAJ Education”.etc

Leave a Reply

Insert math as
Block
Inline
Additional settings
Formula color
Text color
#333333
Type math using LaTeX
Preview
\({}\)
Nothing to preview
Insert
%d bloggers like this: