Identifiers And Keywords in C language : CodeWithMe

 

Keywords and Identifiers


Identifiers:

Identifiers are the names given to various program elements such as constants,

variables, function names and arrays etc. Every element in the program has its own

distinct name but one cannot select any name unless it conforms to valid name in C

language. Let us study first the rules to define names or identifiers.

 

 

Identifiers are defined according to the following rules:

1. It consists of letters and digits.

2. First character must be an alphabet or underscore.

3. Both upper and lower cases are allowed. But each a word in different case will be teated different example. Hello and hello will be different.

4. Except the special character underscore ( _ ), no other special symbols can be

used.

 

Keywords In C language

 

Keywords are reserved words which have standard, predefined meaning in C. They

cannot be used as program-defined identifiers. There 32 keywords in C Here is the list of keywords :


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

Escape Characters :

There are some non-printable characters that can be printed by preceding them with ‘\’ backslash character. Within character constants and string literals, you can write a variety of escape sequences. Each escape sequence determines the code value for a single character. You can use escape sequences to represent character codes: 
  •  you cannot otherwise write (such as \n)
  •   that can be difficult to read properly (such as \t)


No comments

Control Statements (if-else-switch) in C : CodeWithMe

Control Statements in C In a C program, a decision causes a one-time jump to a different part of the program, depending on the value of an e...

Powered by Blogger.