Basic Concepts of C Language

Engg.... | 06:37 | | Best Blogger Tips

CHARACTER SET:
Every programming language has its own set of characters. The characters used in C are divided into 3 categories
  1. Digits
  2. Alphabets
  3. Special characters.
TABLE SHOWS DIFFERENT ALPHABETS , DIGITS , SPECIAL SYMBOLS USED IN C LANGUAGE:


  • ALPHABETS    
  • UPPERCASE                   
  • LOWERCASE                                       
  • A-Z                            
  • a-z                  

  • DIGITS                  
  • 0-9    

  • SPECIAL                CHARACTERS                                                         
  • , COMMA
  • . PERIOD
  • : COLON
  • ; SEMICOLON
  • 'APOSTROPHE            
  • + PLUS SIGN
  • - MINUS SIGN            
  • *ASTERISK                     
  • / SLASH
  • % PERCENTAGE         SIGN
  •   & AMPERSAND
  • ^ CARAT
  • ~ TILDE
  • [ LEFT BRACKET
  • ] RIGHT BRACKET
  • { LEFT                         BRACES                                                 
  • " QUOTATION MARK
  • ? QUESTION MARK                      
  • ! EXPLAMATION   MARK                       
  • _ UNDERSCORE
  • # HASH
  • = EQUAL SIGN
  • | PIPELINE SIGN
  • < LESS THAN
  • > GREATER THAN
  • \ BACKSLASH
  • ( LEFT PARENTHESIS
  • ) RIGHT PARENTHESIS
  • } RIGHT BRACES                                          




C TOKENS:
The individual units C program are known as C tokens. We use 6 types of tokens in any C program
  1. Identifier
  2. Strings
  3. Constants
  4. Keywords
  5. Special symbols
  6. Operators
KEYWORDS AND IDENTIFIERS:
In C program every word is either a identifier or a keyword. There are 32 keywords used in C Language supported by ANSI. Keywords are the reserve words which have one or more fixed meanings and the meaning of all keywords in any circumstances cannot be changed that is why these are reserve words. All the keywords of C Language are written in Lowercase letter because In C Language uppercase and lowercase letters are significant that is different meanings. List of keywords are:


                      TABLE SHOWS DIFFERENT KEYWORDS USED IN C LANGUAGE: 


  • break
  • default
  • extern
  • int                  
  • signed
  • typedef
  • while
  • goto
  • auto
  • continue
  • enum
  • if
  • short          
  • switch
  • volatile
  • void
  • case
  • do
  • float
  • long          
  • sizeof
  • union
  • char
  • double
  • for
  • register
  • static
  • unsigned
  • const           
  • else
  • return
  • struct

IDENTIFIERS: 
Identifiers may be defined as variable name, array name , function name, class name etc.Basically identifiers are the sequence of alphabets and digits.

RULE FOR FORMING IDENTIFIER NAME:
  •  Keywords should not allow to be used as identifier.
  •  Uppercase and lowercase identifiers are different.
  •  The first character must be an alphabet or an underscore.
  •  Two successive underscores are not allowed.
  •  No special characters except underscore "_" are allowed.
  •  All succeeding characters must be either letters or digits.
EXAMPLES:
  •  int a2            VALID
  • int _a23         VALID
  • int a_257       VALID
  • float abc        VALID
  • int a__2         INVALID
  • int 2_b           INVALID
  • int char           INVALID
  • int name         VALID
  • float while      INVALID
  • float !a           INVALID
Please Share it! :)
Do you like this Story?

Get Free Email Updates Daily!

Follow us!

12 comments:

  1. in identifier examples you have given examples in that float abc is given vaild but according to above it is invalid

    ReplyDelete
  2. hello friends visit http://cncreate.blogspot.in/ for better understanding

    ReplyDelete
  3. I very happy to read this informative post.Its a very useful for everyone.

    c language training

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Thanks for sharing this tutorial. C identifiers are case sensitive, which means 'value' and 'Value' will be treated as two different identifiers.

    ReplyDelete
  6. Very Useful information that i have found. don't stop sharing and Please keep updating us..... Thanks

    ReplyDelete

  7. very good information provided you can read the best c Language Interview Questions

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete