Token in C

Token in C|what is Token in C language|all about Tokens|Types of Tokens

 Token in C is the smallest unit of a program that can be understand and divided by its categories by compiler.
when we compile the program several phases occur called tokens? all the alphabets of our programming language are called tokens.tokens can be classified in the following types:-

 Token in C are:

1) Keywords
2) Identifiers
3) Constant
4) Strings
5) Special symbols
6) Operator



    token in c flow chart : keywords,string,identifiers,special symbols.
    Token in C
    (Token in C is the smallest unit of a program that can be understood and divided by compiler. all the alphabets of our programming language are called tokens. Types of Tokens are Keywords, Identifiers, Constants, Strings, Special symbols, Operator)

    1) Keywords:

     Keywords Words are words whose meaning is already defined in 'C' language. and these words are also called reserved words. They are not used in variable and function names. you can't define keyword in your own way or defined keyword cant be redefined. They are as follows :



    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

    2) Identifier: 

    The identifier is naming convention to the user-defined objects like variable, function, array it starts with alphabets A-Z, a-z, '_'(underscore) and there are some rules to declare it. which are as follows : 

    a) Starts with alphabets or underscore.

    b) The keyword can't be used as name.
    c) C is case sensitive so upper case and lower case consider separately. 
    d) There must be space between characters or any identifier's name.
     examples: a b, 2ab, ab#, 123, etc.

    3) Constants:

     Constants are also like variables and the only difference is that their values can not be changed or modified at once the value is declared.constant is also called literals or it refers to the fixed value. constant can be declared in any data types like integer, real or floating number, etc.

    4) Strings: 

    A string could be a knowledge sort utilized in programmings, like associate degree whole number and the floating-point unit, however, is used to represent text instead of numbers. it's comprised of a collection of characters that may additionally contain areas and numbers. 

    Example: The word "hamburger" and therefore the phrase "I Greek deity three hamburgers" area unit each string. Even "12345" can be thought of a string, if such as properly. Typically, programmers should enclose strings in quotation marks for the info to recognized as a string and not a variety or variable name.

    5) Special symbols: 

    The following special symbols are used in C programming having some special means and they can't be used for different purposes.
    Example: [] () , ; * = # etc.
    • Brackets[]: gap and shutting brackets are used as array component reference. These indicate single and three-d subscripts.
    • Parentheses(): These special symbols are wont to indicate perform calls and performance parameters.
    • Braces: These gaps and finishing frizzy braces mark the beginning and end of a block of code containing over one possible statement.
    • The Comma (, ): it's wont to separate over one statement like for separating parameters in performing calls.
    • Semicolon: it's Associate in Nursing operator that basically invokes one thing known as Associate in Nursing formatting list.
    • Asterisk (*): it's wont to produce a pointer variable.
    • Assignment Operator: it's wont to assign values.
    • Preprocessor(#): The preprocessor may be a macro processor that's used mechanically by the compiler to rework your program before actual compilation.

    6) Operators:

    Operators are symbols that trigger Associate in Nursing action once applied to C variables and different objects. the information things on that operator's influence ar known as operands.

    Depending on the number of operands that Associate in Nursing operator will influence, operators will be classified as follows:

    Unary Operators: Those operators that need solely single quantity to influence ar referred to as single operators.For Example increment and decrement operators

    Binary Operators: Those operators that need 2 operands to influence ar known as binary operators. Binary operators are classified into :


    • Arithmetic operators.
    • Relational Operators.
    • Logical Operators.
    • Assignment Operators.
    • Conditional Operators.
    • Bitwise Operators.
       so in the above para, we talked about Tokens its types and all about it. Now the question is how important they are?

    Hence, after reading above all details about a Token now you can understand that without its coding is not possible. because they are BRICKS by which we create our program foundation. indirectly we can say that they are building blocks. 

    In the above article, we talked about Tokens in c but tokens are used in every programing language as we know " Programing is a concept and programming languages are different ways to Write those languages in desired Ways.

    So understanding about tokens will always help in growth in the Field of programing it is used everywhere but in desired ways. understanding Tokens concept is easy if you know about bit of programing its just a cup of Tea. They are basic concepts that help to clarify all the big ones. and anyone Knows any old programming language then its batter chance for them to switch with new one and understand concepts in their own way. we suggest - Learning is all about experiences if you do more practices there are more chances for you to clear the Concept and when the concept is clear then you are the only one who knows about its all behavior and its all solutions. 

    "So at the end, we can only say that experience your work the more you experience more you connect with it. and if you got connected then the work (or job) you experienced will become yours. 😉 - Rohit Soni"

    Article Re-Updated on 14-06-2020 by RS

    In Our last Article We talked about Basics about C Programing language check out here and this is 2nd part of series.

     Thanks For Giving Time On Our Article To stay updated and to get earlier notifications of our articles "Press Subscribe Button In POPUP BOX" It's Absolutely Free. 

    Above Image Is Property of tech-updates.in and its Owner RS Tech PVT.LTD and Respective owners. reuse without permission for any purpose is strictly prohibited. For any query or permissions contact us.


    #Tokens in c #c programing language #tokens #cseries 

    Post a Comment

    0 Comments