The smallest individual elements or units in a program are called as Tokens. C has following tokens.
1.Identifiers
2.Keywords
3.Constants
4.Operators
5.Special Characters.
1.Identifiers
Identifiers refer to the name of the variables, functions, arrays, etc. created by the programmer, using the combination of the following characters.
1.Alphabets : A to Z and a to z
2.Digits : 0 to 9
3.Underscore : _
Note:
1. The first character of an identifier must be an alphabet or underscore, we cannot use digit.
2. Default identifiers length is 32 characters.
2.Keywords:
Keywords are the words whose meaning has been already explained by the compiler. That means at the time of designing a language, some words are reserved to do specific tasks. Such words are called keywords (or) reserved words. All C compilers support 32 keywords.
They are:
1.auto
2.break
3.char
4.char
5.const
6.continue
7.default
8.do
9.double
10.else
11.enum
12.extern
13.float
14.far
15.for
16.goto
17.if
18.int
19.long
20.register
21.return
22.short
23.signed
24.sizeof
25.static
26.struct
27.switch
28.typedef
29.union
30.unsigned
31.void
32.while
3.Constants:
Constants define fixed values, that do not change during the execution of a program. C supports the following constants.
1.Integer Constants
2.Character Constants
3.Real (or) floating constants
4.String Constants
4.Operators:
Operators is a symbol which performs particular operation. C supports a rich set of operators. C operators can be classified into No of categories. They include arithmetic operators, logical operators, bitwise operators, etc.
5.Special Characters:
All characters other than alphabets and digits are treated as special characters.
EG: !, @, #, $, %, ^, &, *, (, ), _, +, -, [, ], etc.,
No comments:
Post a Comment