Recent

Analytics.

Facebook

Paling Dilihat

Token and Keywords in C

C TOKENS :

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,

Keywords (eg: int, for),

Identifiers (eg: main),

Constants (eg: 10, 20),

Special symbols (eg: (), {}),

Operators (eg: +, /,-,*)

Keywords :

Keywords are preserved words that have special meaning in C language. The meaning of the keywords has already been described to the C compiler. These meaning cannot be changed. Thus, the keywords cannot be used as variable names because that would try to change the existing meaning of the keyword, which is not allowed. There are total 32 keywords in C language.

As C is a case sensitive language, all keywords must be written in lowercase. Here is a list of all keywords allowed in ANSI C.

For example:

int money;

Here, intis a keyword that indicates money is a variable of type integer.

Keywords in C Language

auto

double

int

struct

break

else

long

switch

case

enum

register

typedef

char

extern

return

union

continue

for

signed

void

const

float

static

while

default

goto

sizeof

volatile

do

if

short

unsigned

Along with these keywords, C supports other numerous keywords depending upon the compiler.

Identifier :

In C language identifiers are the names given to variables, constants, functions and user-define data. These identifier are defined against a set of rules.