Special Symbols
Special symbols are the token characters having specific meanings within the syntax of the programming language. These symbols are used in a variety of functions, including ending the statements, defining control statements, separating items, and more.
Below are the most common special symbols used in C++ programming:
- Semicolon (;): It is used to terminate the statement.
- Square brackets []: They are used to store array elements.
- Curly Braces {}: They are used to define blocks of code.
- Scope resolution (::): Scope resolution operator is used to access members of namespaces, classes, etc.
- Dot (.): Dot operator also called member access operator used to access class and struct members.
- Assignment operator ‘=’: This operator is used to assign values to variables.
- Double-quote (“): It is used to enclose string literals.
- Single-quote (‘): It is used to enclose character literals.
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.