Escape Character, Escape Character Table
The escape character is a special character constant. The escape character starts with a backslash "\" followed by one or more characters. An escape character has a specific meaning, which is different from the original meaning of the character, so it is called an "escape" character. For example, the "\ n" used in the format string of the previous example printf function is an escape character, which means "carriage return and line feed". Escape characters are mainly used to represent control codes that are not easily represented by ordinary characters.
Common escape characters and their meanings
Escape character meaning of escape character
\ n carriage return
\ t Skip to next tab position
\ v vertical tab vertical tab
\ b backspace
\ r enter
\ f Form feed
\\ backslash character "\"
\ 'Single quote
\ a ringing
\ ddd Characters represented by 1 to 3 octal numbers
\ xhh Characters represented by 1 to 2 digit hexadecimal numbers
Broadly speaking, any character in the C language character set can be represented by escape characters. \ ddd and \ xhh were proposed for this purpose. ddd and hh are ASCII codes in octal and hexadecimal, respectively. For example, \ 101 means the word? Quot; A ", \ 102 means the letter" B ", \ 134 means a backslash, \ XOA means a line feed, etc.