C token keywords & identifiers
C Tokens:
C Tokens In a passage of text, individual words and punctuation marks are called tokens or lexical units. Similarly, the smallest individual unit in a c program is known as a token or a lexical unit. C tokens can be classified as follows:
C Tokens In a passage of text, individual words and punctuation marks are called tokens or lexical units. Similarly, the smallest individual unit in a c program is known as a token or a lexical unit. C tokens can be classified as follows:
C Keywords:
C Keywords C keywords are the words that convey a special meaning to the c compiler. The keywords cannot be used as variable names because by doing so, we are trying to assign a new meaning to the keyword which is not allowed.
The list of C keywords is given below:-
C Keywords C keywords are the words that convey a special meaning to the c compiler. The keywords cannot be used as variable names because by doing so, we are trying to assign a new meaning to the keyword which is not allowed.
The list of C keywords is 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 |
C Identifiers:Identifiers are used as the general terminology for the names of variables, functions and arrays. These are user defined names consisting of arbitrarily long sequence of letters and digits with either a letter or the underscore(_) as a first character.
There are certain rules that should be followed while naming c identifiers:-
Some examples of c identifiers:-
There are certain rules that should be followed while naming c identifiers:-
Name | Remark |
---|---|
_A9 | Valid |
Temp.var | Invalid as it contains special character other than the underscore |
void | Invalid as it is a keyword |
C token keywords & identifiers
Reviewed by ANAND PANDEY
on
7:41:00 AM
Rating:
No comments: