What is the meaning of escape characters in C language?

Escape characters in the C language refer to special character sequences used to represent characters that cannot be entered or displayed directly. These escape characters typically begin with a backslash (\) followed by one or more characters. Common escape characters in the C language include:

  1. \n: line break character
  2. – Tab: tabulation character
  3. Carriage return
  4. \b: backspace character
  5. \f: Page break
  6. \a: ringing symbol
  7. /

    Backslash

  8. ‘ – single quotation marks
  9. Quotation marks
  10. Question mark
  11. \0: signifies the end of a string
  12. \xhh: represents a two-digit hexadecimal number, used to denote the ASCII code value of the character hh.

By using escape characters, we can insert special characters in a string or display some characters that cannot be directly inputted in the output. For example, using \n as an escape character can insert a new line in a string, while using \t can insert a tab.

bannerAds