Tokens in C Programming

Tokens in C Programming


Welcome friends to our third C tutorial.
Hope you would have gone through our last tutorial.
In this part of the tutorial we would be talking about the tokens.
So before we start I want to state that anything in this world has individual or the smallest
unit. Like cell are the smallest unit of life in
our body. Similarly tokens are the smallest individual
units that make up a complete C program. Just imagine of a brick many a brick come
together to form a house. Similarly tokens come together to form a program.
Now, tokens can be categorized into 6 categories these are
Keyword Identifier
Constant Strings
Operators and Punctuators
What are keywords ? So let us talk about the keywords.
Basically Keywords are the reserved words or pre-defined words whose meaning is already
known to the compiler. Each keyword perform a particular task and
we can not use keyword to name something or as identifiers.
Each keyword perform a particular task. They have different properties.
32 keywords had been defined by C89. Few of the examples are int, float, void,
goto, etc. We would be coming across many keywords as
we proceed with programming in further tutorials. Now lets talk about Identifier.
Identifiers are the name given to variables, constants, functions and user-defined data.
We would be talking about functions in later tutorials.
Suppose if we all did not had a name than how we would be communicating with each other.
How we would be calling each other eventually there would be a big blunder.
Similarly identifier are just like name they help name different parts in a program.
Like a is the identifier in int a or b is the identifier in float b.
We would understand more easily about identifier as we proceed with programming in later tutorials.
Now let’s talk about constants. Constants are those quantities whose value
are fixed and can not be changes or altered. If we go in detail than constant have a fixed
value in the memory. For example 1, 2 are the constants.
We can not change their values and if we add the keyword ‘const’ for int a or in front
of anything than it is also a constant whose value can not be altered. Here int a=5.
In any proceeding programming we can not change the value of ‘a’.
Now let’s talk about Strings. String in C programming language is actually
a one-dimensional array of characters which is terminated by a null character ‘’.
Now you would be worrying about the arrays. Array is a particular chapter in C of which
we would be dealing in later tutorials. Just you need to understand that each letter
in the word “Hello” is a character like ‘H’ is a character, ‘e’ is a character, ‘l’ is
a character and group of the characters form a string.
Like a group of letters form a word. Now let’s talk about the operators.
What basically an operator is. An operator is a symbol that tells the compiler to perform
specific mathematical or logical operation. Like the ‘+’ sign would instruct the compiler
to add where as the ‘-‘ sign would instruct the compiler to subtract.
There are various categories of operators which we would be discussing in latter tutorials.
Currently you just need to know that operators are special symbols that instruct the compiler
to perform specific mathematical or logical operations.
Now let’s talk about the punctuators. Punctuators separate two statements.
Infact the whole C program is made up of punctuators. The ‘;’ indicates the end of the statement
and the ‘{}’ indicate a block of code while the square brackets indicate an array.

21 thoughts on “Tokens in C Programming”

  1. Thanks for the video and I really appreciate your efforts.. Just one thing that I would like to say is that, your voice isn't clear.. it is a bit difficult to understand what you speak.

  2. Hi,you have done a great job,i totally understand about it ,dude i also written about it ,check out https://madhavbansal.blogspot.com/2019/04/tokens-or-lexical-units-in-c.html
    also https://madhavbansal.blogspot.com/

Leave a Reply

Your email address will not be published. Required fields are marked *