Search This Blog


Saturday, September 14, 2019

#2 Tokens of C


➤ Escape sequence

  • C supports the combinations of backslash ( \ ) and some characters from the C character for representing these characters in our C programs.
  • These combinations are known as escape sequence and are represented by two characters.
  • The first character is "\" and second character is from the C character set.

Some escape sequence are:-

  1.     \b = backspace
  2.     \a = alert
  3.     \r = carriage return
  4.     \n = newline
  5.     \f = form feed
  6.     \0 = null character
  7.     \v = vertical tab
  8.     \t = horizontal tab
  9.     \\ = backslash

➤ Keywords/Reserved words

  • There are certain words that are reserved for doing specific tasks. They are known as keywords.
  • They have standards and predefined meaning in C.
  • They are always written in lowercase.
  • There are only 32 keywords available in C.

All 32 keywords are:-

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

No comments:

Post a Comment