Tokens


What is tokens ?


Tokens are the smallest individual unit of a program . One or more characters are grouped in sequence to form meaningful words .these words are called tokens

Types of Tokens


Keywords


The words that are understood by compiler is called keywords. it is a predefined or reserved word in C library with a fixed meaning and used to perform an internal operation

Example

Suppose we write rach it is not meaningful but if we arrange rach====>into ==>char==>Identified by compiler===>i.e ==> keywords

There are 32 keywords in C

autodoubleintstructbreakelse
lognswitchcaseenumregistertypedef
charexternreturnunionconstfloat
shortunsignedcontinueforsignedvoid
defaultgotosizeofvolatiledoif
staticwhile




Identifier


Identifiers are the names given to variables, constants, functions and user-define data while writing a program . It consists of sequence of one or more letters or digits along with “ “

Example

Suppose we write reaa it is not meaningful but if we arrange reaa====>into ==>;area==>Understand by programmer i.e identifier

Rules for an Identifier