C Language / Tokens, Identifiers & Keywords in C Language

Tokens in c Language
Each and every smallest individual unit in a C program are known as C tokens and considered as basic buildings blocks of C language.C tokens are of 6 types. They were

Tokens Type Example
Keywords For, int, while e.t.c
Identifiers main, total e.t.c
Constants 20, 40, 60 e.t.c
Strings “sum”, “average”,”total”
Special symbols , , {, }
Operators +, /,-,*

Identifiers
It is a name used to identify a variable / function / any other thing defined by user and it starts with a letter A to Z, a to z, or an underscore '_' followed by letters, and digits (0 to 9) and punctuation characters not are allowed (Like @, $, and %) within identifiers. Identifiers are case sensitive i.e "SUM", "sum" are treated differently.

Keywords
They are the predefined words used in the c language and each keyword with a specific meaning and purpose and it can’t be used as variable name. They were 32 keywords are there C language.

auto else long switch
break enum register typedef
case extern return union
char float short unsigned
const for signed void
continue goto sizeof volatile
default if static while
do int struct double


Home     Back