C Tokens and Keywords

C Tokens :

A smallest individual unit in C program is known as C Token. Tokens are either keywords, identifiers, constants, variables or any symbol which has some meaning in C language.

Now for example lets take a look at below C example code :
#include  <stdio.h>

int main() {

  printf("Hello world.!!\n");
  return 0;

}
If we take a line of statement,
printf("Hello world.!!\n");
The tokens at the above lines are printf, (, "Hello world.!!\n", ) and ;. So we can say that basically C tokens are the building blocks of a C program.

C tokens, Identifiers and Keywords are the basics in a C program. C tokens are of six types :

1. Keywords
2. Identifiers
3. Constants
4. Strings
5. Special symbols
6. Operators

C Keywords :

Every C word is classified as either keyword or an identifier. All keywords have fixed meanings and these meaning cannot be changed. Keywords serve as basic building blocks for program statements. The list of all keywords are listed below

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

Also note that all the keywords must be written in lowercase. 

C Identifiers :

Identifiers refers to the name of variables, functions and arrays. These are user-defined names and consists of a sequence of letters and digits, with a letter as a first character. Both uppercase and lowercase letters are permitted, although lowercase letters are commonly used. The underscore '_' character is also permitted in identifiers. It is usually used as a link between two words in long identifiers. For example :
int Hash_Value;
C does not allow punctuation characters such as @, $, and % within identifiers. Ans also C is a case-sensitive programming language, thus NUM and num are two different identifiers in C. Below are some examples of acceptable identifiers :
num    NUM    n1    var_123    john90    _var90

Next Topic :