Welcome back! In my last post, I explain about struture of C program after that we need to know about C tokens.
So in this post I will explain about what is Tokens,
How many types of C tokens and all that things. So let’s start…
In Genral text, a word and punctuation marks are called
tokens. In C program the smallest individual units are known as Token.
The following six types of tokens are used in C language:
1) Keywords: Following keywords available in C:
1) Keywords: Following keywords available in C:
auto
|
break
|
case
|
char
|
|
const
|
continue
|
default
|
do
|
|
double
|
else
|
enum
|
extern
|
|
float
|
for
|
goto
|
if
|
|
int
|
long
|
register
|
return
|
|
short
|
signed
|
sizeof
|
static
|
|
struct
|
switch
|
typedef
|
union
|
|
unsinged
|
void
|
volatile
|
while
|
2) Identifiers:
An identifier is a sequence of characters that represents an entity such as a
function or a data object.
3) Constants:
Constant is a value that can be stored in the memory and cannot be changed
during execution of the program.
4) Strings
(Alphabets): A string is a sequence of characters.
Strings are stored in memory as ASCII codes of characters that make-up the
string appended with’\0’(ASCII value of null). Normally each character is
stored in one byte, successive characters are stored in successive bytes.
5) Variables ( special symble):
Variable is a named location in memory, i.e., used to hold a value that can be
modified by the program. These variables can take different values but one at a
time. The values of variables can be changed during execution. All the variables
should be declared before they can be used.
6)Operators: An operator is a symbol that tells the processor to perform certain mathematical or logical manipulations. Operators are used in programs to manipulate data and variables. The data itself is called ’operand’.
6)Operators: An operator is a symbol that tells the processor to perform certain mathematical or logical manipulations. Operators are used in programs to manipulate data and variables. The data itself is called ’operand’.
0 comments:
Post a Comment