C Token and Keyword
The C tokens are the basic buildings blocks in Clanguage which are constructed together to write a C program.
Each and every smallest individual unit in Cprogram is known as C Tokens.
There are six types of tokens in C language that are given below:
Lets us consider an example of Token.
Keywords in C
Keyword is used to perform an internal operation. We cannot use it as the variable name, constant name etc.
Every keyword exists in lower case latter like auto, break, case etc.
There are 32 keywords in C language.
Identifiers in C
The identifier is a name used to identify a variables, constants, functions and user-defined data. There are following some rules for naming identifier.
- It can only alphanumeric characters (a-z, A-Z, 0-9) and underscore
( _) symbol.
- Identifier names must be unique.
- The first character names must be unique.
- We cannot use a keyword as identifiers.
- Only first thirty-one (31) characters are significant.
- Must not contain white spaces.
- Identifiers are case-sensitive.
In the given above example amount and total balance are identifiers and double is a keyword.
Constant in C
Constant is a variable that value never change during execution once defined. It is also known as literals. Const keyword is used to define a constant.
const type constant_name;
constint ID =10;
Strings in C
String constants are the sequence of characters enclosed within double quotes.
Every string constant is automatically terminated with a special character called the null character which represents the end of the string.