Escape Character Table and escape table
Some Characters in the ASCII table cannot be printed. How do I express these unprintable characters?
C provides three representation methods.
I. use ASCII codes directly
2. Use a special symbolic sequence, that is, escape characters.
3. C90 supports representing character constants in hexadecimal format (in this form, the backslash is followed by an x or X, followed by a 1 to 3 hexadecimal number)
Escape Character ASCII value (decimal) Meaning
\ A 7 Gbit/s (terminal bell or speaker beep)
\ B 8 return
\ F 12 Paper
\ N 10 line feed
\ R 13 press ENTER
\ T 9 horizontal Tab
\ V 11 vertical Tab
\ 92 backslash (\)
\ '39 single quotes (')
\ "34 double quotes (")
\? 63 question mark (?)
\ 0 0 NULL character (NULL)
\ Ooo octal value (o indicates an octal number)
\ Xhh hexadecimal value (h indicates a hexadecimal number)
These escape characters may not apply to all devices. for example, take the paper symbol (\ f) and vertical Tab character (\ v) to generate strange symbols on the screen without any cursor movement, they only work as described when output to the printer.
If you want to select between an escape character and its corresponding ASCII code, it is best to use the escape character. first, escape characters are easier to remember. Second, this makes the program more portable. because escape characters are still applicable in systems that do not use ASCII codes.