A token in C can be defined as the smallest individual element of the C programming language that is meaningful to the compiler. It is the basic component of a C program.
Types of Tokens in C
The tokens of C language can be classified into six types based on the functions they are used to perform.
The types of C is divided into 6 types:
- Keywords
- Identifiers
- Constants
- Strings
- Special Symbols
- Operators
Keywords
Keywords are predefined or reserved terms in a programming language.
Every keyword is designed to carry out a particular task in a program.
Because keywords are reserved terms for the compiler, they cannot be used as variable names, as doing so would attempt to assign a new meaning to the keyword, which is not permitted. Keywords cannot be redefined.
C language supports 32 keywords which are given below:
| auto | double | int | struct |
| break | else | long | switch |
| case | enum | register | typedef |
| char | extern | return | union |
| const | float | short | unsigned |
| continue | for | signed | void |
| default | goto | sizeof | volatile |
| do | if | static | while |