| Escape character |
Meaning |
ASCII code value (decimal) |
| \a |
Bell (BEL) |
007 |
| \b |
BACKSPACE (BS), moves the current position to the previous column |
008 |
| \f |
Page Break (FF), moving the current position to the beginning of the next page |
012 |
| \ n |
Line Break (LF), move the current position to the beginning of the next line |
010 |
| \ r |
Carriage return (CR), moving the current position to the beginning of the bank |
013 |
| \ t |
Horizontal tab (HT) (jumps to the next tab position) |
009 |
| \v |
Vertical tabulation (VT) |
011 |
| \ \ |
Represents a backslash character ' \ ' |
092 |
| ? |
? |
? |
| \ ' |
Represents a single quotation mark (apostrophe) character |
039 |
| \ " |
Represents a double-quote character |
034 |
| \ |
Null character (NULL) |
|
| \DDD |
Any character represented by 1 to 3 octal digits |
Three-bit octal |
| \xhh |
Any character represented by 1 to 2 hexadecimal digits |
Two-bit hexadecimal
|
the following issues need to be noted when using escape characters:
- 1) Only lowercase letters can be used in escape characters, and each escape character can only be treated as one character.
- 2) \v Vertical tabs and \f page breaks have no effect on the screen, but affect the printer's response actions.
- 3) in C programs, when non-printable characters are used, they are usually represented by escape characters.
- 4) The escape character ' \ s ' means null, and its value is 0. The ASCII code value of the character ' 0 ' is 48. Therefore, the null character ' \ s ' is not a character 0. Additionally, the null character is not equal to the space character, and the ASCII value of the space character is 32 instead of 0. When compiling procedures, the reader should distinguish clearly.
- 5) If the character after the backslash and it does not form an escape character, then ' \ ' does not escape the function will be ignored.
See: escape characters in the C language
Escape characters in the C language