Character Set,Identifiers and Keywords by G Krishna Chauhan


Whenever we write any C program then it consists of different statements. Each C Program is set of statements and each statement is set of different c programming lexims. In C Programming each and every character is considered as single lexim. i.e [ Basic Lexical Element ]

Character Set Consists Of –

Types Character Set
Lowercase Letters a-z
Uppercase Letters A to Z
Digits 0-9
Special Characters !@#$%^&*
White Spaces Tab Or New line Or Space


IDENTIFIERS IN C LANGUAGE:

Each program elements in a C program are given a name called identifiers.
Names given to identify Variables, functions and arrays are examples for identifiers. eg. x is a name given to integer variable in above program.

RULES FOR CONSTRUCTING IDENTIFIER NAME IN C:

  • First character should be an alphabet or underscore.
  • Succeeding characters might be digits or letter.
  • Punctuation and special characters aren’t allowed except underscore.
  • Identifiers should not be keywords.


KEYWORDS IN C LANGUAGE:

Keywords are pre-defined words in a C compiler.
Each keyword is meant to perform a specific function in a C 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. Click on each keywords below for detail description and example programs.

  1. auto
  2. double
  3. int
  4. struct
  5. const
  6. float
  7. short
  8. unsigned
  9. break
  10. else
  11. long
  12. switch
  13. continue
  14. for
  15. signed
  16. void
  17. case
  18. enum
  19. register
  20. typedef
  21. default
  22. goto
  23. sizeof
  24. volatile
  25. char
  26. extern
  27. return
  28. union
  29. do
  30. if
  31. static
  32. while



No comments:

Post a Comment