Tuesday, November 07, 2017

Tokens of C language

Tokens in C:

¾     C tokens are the basic buildings blocks in C language which are constructed together to write a C program.
¾     Each and every smallest individual units in a C program are known as C tokens.
¾     C tokens are of six types. They are,

     1.      Character sets
2.      Keywords
3.      Identifiers
4.      Constants and Variables
5.      Strings
6.      Operators

1. Character sets

¾     The character set of any programming language indicates the different characters the program can contain.
¾     Character set includes all the alphabets, digits and special symbols supported by the processor.
¾     When we will be writing C programs, all these will be found in our program.

¾     Each of these special symbols may have some significance which will be discussed in the forthcoming chapters.
Types
Character Set
Lowercase Letters
a-z
Uppercase Letters
A to Z
Digits
0-9
Special Characters
!@#$%^&*
White Spaces
Tab Or New line Or Space

 Valid C Characters: Special Characters are listed below

Symbol
Meaning
Symbol
Meaning
Symbol
Meaning
~
Tilde
_
Underscore
]
Right bracket
!
Exclamation mark
+
Plus sign
:
Colon
#
Number sign
|
Vertical bar
Quotation mark
$
Dollar sign
\
Backslash
;
Semicolon
%
Percent sign
`
Apostrophe
< 
Opening angle bracket
^
Caret
Minus sign
> 
Closing angle bracket
&
Ampersand
=
Equal to sign
?
Question mark
*
Asterisk
{
Left brace
,
Comma
(
Left parenthesis
}
Right brace
.
Period
)
Right parenthesis
[
Left bracket
/
Slash

No comments: