- Token in C is the most important element to be used in creating a program in C.
- The token in C can be defined as the smallest individual element in C.
- Tokens are the building block or the basic component for creating a program in the C language.
There are five types of tokens in C
- Keywords
- Identifiers
- Literals
- Strings
- Operators
1. Keywords: Keywords are the reserved words which convey a special meaning to the language (C) compiler.
2. Identifiers: Identifiers are fundamental building blocks of a program and are used as the general terminology for the names given to different parts of program. viz variables, functions, arrays, classes, etc.
3. Literals: Literals (often referred to as constants) are data items that are fixed data values.
4. Strings: It is a sequence of characters that ends with null characters (\0).
5. Operators: Operators are special symbols that perform specific operations on one, two, or three operands and then return a result.