This blog is under construction

Thursday, 26 December 2013

What is a c token?

What is a token in c language?
Token is the basic fundamental unit that makes up C source code after pre-processing.  

What are the various c tokens?
There are five types of C tokens.  They are
1. keywords
2. identifiers
3. constants
4. operators
5. separators

Identifiers:
Identifiers are nothing but name of the variable, function, macros or enums.  Name of an identifier can be formed using alphabets, numbers, underscore(_) and dollar($).  Please note that name of identifier starting with number is not allowed in C programming language

Keywords:
Its a set of words in C programming language which cannot be used as identifiers and they are reserved by programming language itself to perform specific operation.

Constants:
Any unchanged numeric, character, real value or string is a constant.

Operators:
It is a token which can be used to perform operation like arithmetic, logical, comparison, increment, decrement, bitwise etc.

Separators:
Separators used to separate tokens.

  C Tokens   Examples                         
Keywords auto, do, while, for, struct, break etc
Identifiers num, val, file_name etc
Constants 0x10, 3.14, 'c', "string" etc
Operators +, -, *, / etc
Separators ;  :  ,  .  (  )  [  ]  {  } etc



1 comment:

  1. Dell Laptop Service center are giving repair service at the door. We should high quality Dell out of warranty Laptop Repair, removal of virus, screen removal, wireless network set up, battery removal, motherboard replacement to several other are offered at budget friendly price and it’s Negotiable. We can fix them all in time by our well experience and certified technicians. If you want to repair your laptop in front of your eyesight, than you may call us: 7217871051

    ReplyDelete