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.

Similar Reads

Types of Tokens in C++

We have several types of tokens each of which serves a specific purpose in the syntax and semantics of C++. Below are the main types of tokens in C++:...

1. Identifiers

In C++, entities like variables, functions, classes, or structs must be given unique names within the program so that they can be uniquely identified. The unique names given to these entities are known as identifiers....

2. 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....

3. Constants

Constants are the tokens in C++ that are used to define variables at the time of initialization and the assigned value cannot be changed after that....

4. Strings

In C++, a string is not a built-in data type like ‘int’, ‘char’, or ‘float’. It is a class available in the STL library which provides the functionality to work with a sequence of characters, that represents a string of text....

5. 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....

6. Operators

C++ operators are special symbols that are used to perform operations on operands such as variables, constants, or expressions. A wide range of operators is available in C++ to perform a specific type of operations which includes arithmetic operations, comparison operations, logical operations, and more....