Tokens In C Programming
What is a token in c language?
Token is the basic fundamental unit that makes up C source code after pre-processing.
There are six types of token in C.
Token is the basic fundamental unit that makes up C source code after pre-processing.
There are six types of token in C.
- Keywords: Keywords are special words that are used to give a special meaning to the program and can’t be used as variable and constant. They are basically a sequence of characters that have fixed to mean for example break, for, while, do-while, do, if, int, long, char.
- Identifiers: Identifiers are the sequence of alphabets and digit, but keyword should not be used as an identifier.
- Constants: The quantity which does not change during the execution of a program is known as constant. There are types of constant.
- Variables: Variables are used to give the name and allocate memory space. An entity that may vary data during execution. For example, sum, area, a, b, age, city.
- String: String is a collection of more than one character. For example, “RAM”, “Meerut”, “Star” String is represented by a pair of double quotes.
- Operators: Operators acts as connectors and they indicate what type of operation is being carried out. The values that can be operated by these operators are called operands. They are used to perform basic operations, comparison, manipulation of bits and so on.
- C Tokens Examples
- Identifiers num, val, file_name etc
- Constants 0x10, 3.14, 'c', "string" etc
- Operators +, -, *, / etc
- Keywords auto, do, while, for, struct, break etc
- Separators ; : , . ( ) [ ] { } etc
Thanks For Visiting Please Subscribe and Follow Us ...KeepVisiting 🌝🌝🌝🌝
Comments
Post a Comment