C – Tokens
Tokens are the basic building blocks in the C language which are constructed together to write a C program. Each and every smallest individual unit in a C program are known as C tokens.
Various C tokens are as follows:
- Keywords
- Identifiers
- Constants
- Strings
- Special symbols
- Operators
Keywords in C language:
Keywords are predefined terms within a C compiler. Each keyword is designed to carry out a specific function within a C program.

Identifiers in C language:
Every element of a C program is assigned a name called identifiers.Names Given for Identification Variables, functions, and arrays are examples of identifiers.
Example:
Int x; Float f; Char c; double d;
Here x, f, c, d are the names given to integer, float, char, and double variables.
Rules for constructing identifier name in C:
- The first character must be an alphabet or underscore.
- Subsequent characters can be numbers or letters.
- Punctuation and special characters are not permitted, except underscore.
- Identifier must not be a keyword
Constants:
C Constants are also normal variables, but only the difference is that their values cannot be changed by the program once they are defined. The constants refer to fixed values and are also called literals. We can’t change constant values after defining in C program, it will throw an error.
We can define constants in a C program as shown below.
- By the “const” keyword
- By “#define” preprocessor directive
Syntax:
Const data_type variable_name; (or) const data_type *variable_name;
Types of C constant:
- Integer constants
- Real or Floating-point constants
- Octal & Hexadecimal constants
- Character constants
- String constants
- Backslash character constants
Rules for constructing C constant:
- Integer constants in C:
- An integer constant must have at least one digit.
- It must not have a decimal point.
- It can either be positive or negative.
- Commas and whites are not allowed as part of an integer constant.
- If no sign precedes an integer constant, the constant is assumed to be positive.
- The permitted range for integer constants is -32768 to 32767
Example:
int (12, -762, -8, etc.) unsigned int (500u, 90U, etc.)
- Real constants in C:
- A real constant must have at least one digit.
- It must have a decimal point.
- It could be either positive or negative.
- Commas and whites are not allowed as part of an real constant.
Example:
float (0.456789) double (123.123456789)
- Character and String constants in C:
- A character constant is a single alphabet, a single digit, or a single special symbol enclosed within single quotes.
- The maximum length for any character constant is 1 character.
- String constants are enclosed within double-quotes.
Example:
char (‘A’)
- Backslash character constants in C:
- Certain characters have a particular significance in C
- They must be preceded by a backslash symbol to use a special function from them.

Strings in C language:
C strings are considered as a character array. This is included in double-quotes, contrary to characters that are stored in single quotes. The end of a string is represented by the null character ‘ \0′. The length of a string is the number of individual characters available to it.
Example:
char abc[20]= “i2tutorials”; // Compiler reserves 20 bytes of memory
char abc[]= “i2tutorials”; // Compiler reserves required amount of memory
char abc[10]= {‘d’, ‘j’,’c;, ‘m’, ‘\0’ }; // string represented as a set of characters
Special symbols:
These manipulate or perform data operations. Every special symbol has a specific significance for the C compiler.
[] – The opening and closing brackets of a table indicate a unique and multidimensional index.
{} – Indicates the beginning and end of a particular code snippet that can be functions or loops or conditional statements.
() – Represents function declarations and function calls in print statements.
, – Separates more than one statement.
. – Used to access members of a structure.
# – It is a preprocessor directive used to indicate how to use a header file.
~ – Utilized as a destructor to free memory.
* – To declare pointers, used as an operand for multiplication.