What is Token in C?

C Tokens

A token is the smallest element of a program that is meaningful to the compiler.

Six types of tokens are commonly used in C programming:

  1. Keywords
  2. Identifiers
  3. Constants
  4. Strings
  5. Special Symbols
  6. Operators
Keyword: Keywords are pre-defined or reserved words in a programming language. Each keyword is meant to perform a specific function in a program. Since keywords are referred names for compiler, they can’t be used as variable name.  

C language supports 32 keywords which are given below:
auto         double      int        struct
break        else        long       switch
case         enum        register   typedef
char         extern      return     union
const        float       short      unsigned
continue     for         signed     void
default      goto        sizeof     volatile
do           if          static     while
 

article sourse

Comments