0% found this document useful (0 votes)
6 views1 page

C Tokens

In C programming, tokens are the smallest individual units, including keywords, identifiers, constants, strings, special symbols, and operators. Keywords are predefined and cannot be altered, while identifiers are user-defined names for variables, functions, and arrays, typically limited to 8 characters and must start with a letter. The document outlines the rules and examples for both keywords and identifiers in C.

Uploaded by

kenilkinda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

C Tokens

In C programming, tokens are the smallest individual units, including keywords, identifiers, constants, strings, special symbols, and operators. Keywords are predefined and cannot be altered, while identifiers are user-defined names for variables, functions, and arrays, typically limited to 8 characters and must start with a letter. The document outlines the rules and examples for both keywords and identifiers in C.

Uploaded by

kenilkinda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

2.

4 C TOKENS
The next step after the definition of the character set is the formation of words,
keywords etc. The smallest individual units in a C program are called tokens. The
alphabets, numbers and special symbols are combined to forms these tokens. The
types of tokens in C are :
- Keywords
- Identifiers
- Constants
- Strings
- Special Symbols
- Operators
We shall study each of these tokens in detail.

2.4.1 Keywords and identifiers :


Keywords :
Keywords are words whose meanings have already been defined and these
meanings cannot be changed. Keywords are also called as reserved words. Keywords
should not be used as variable names (though some compilers allow you to construct
variable names like keywords). All the keywords must be written in lowercase.
There are 32 keywords in C as given below :
auto double if static
break else int struct
case enum long switch
char extern near typedef
const float register union
continue far return unsigned
default for short void
do goto signed while
At this moment it is not necessary for you to learn all these keywords. The
detailed discussion of these keywords and their meanings shall be dealt with as and
when we shall study their usage.

Identifiers :
Identifiers are names given to variables, functions and arrays. These are the
names which are user defined. They are made up by a combination of letters and
digits. Normally an identifier should not be more than 8 characters long. The use of
underscore is also permitted in identifiers. However, it is imperative that identifiers
should begin with a letter.
Some examples of identifiers are : min1
Max-temp
temp() etc.
C does not permit use of blank spaces, tabs, commas or special characters in
identifiers. Thus:
mi n1
max*temp
12temp
are invalid identifiers in C.

Beginning with C / 23

You might also like