C # escape characters,
All ASCII codes can be represented by "\" and numbers (generally Octal numbers. C defines some common ASCII characters that cannot be displayed, such as \ 0, \ t, \ n, which are called escape characters, because the subsequent characters do not mean their original ASCII characters.
All escape characters and their meanings:
Escape characters |
Meaning |
ASCII value (decimal) |
\ |
Bell (BEL) |
007 |
\ B |
Return to BS to move the current position to the previous column. |
008 |
\ F |
Change page (FF), move the current position to the beginning of the next page |
012 |
\ N |
Line feed (LF), move the current position to the beginning of the next line |
010 |
\ R |
Press enter (CR) to move the current position to the beginning of the line |
013 |
\ T |
Horizontal tabulation (HT) (jump to the next TAB) |
009 |
\ V |
Vertical tabulation (VT) |
011 |
\\ |
Represents a backslash character ''\' |
092 |
|
|
|
\' |
Represents a single quotation mark (apostrophes) character |
039 |
\" |
Represents a double quotation mark character |
034 |
\ 0 |
NULL) |
000 |
\ Ddd |
Any character from 1 to 3 octal digits |
Three octal nodes |
\ Xhh |
Any character in hexadecimal notation between 1 and 2 |
Two hexadecimal |
Note: Yes. slashes: "/" and backslash: "\" are not interchangeable here.
Constant
Constant represents the value that can be contained in a variable. We can use an ASCII expression to represent a constant of the escape type, or use a backslash to represent escape characters in single quotes.
'A', '\ x2f',' \ 013 ';
Where: \ x indicates that the subsequent characters are hexadecimal numbers, and \ 0 indicates that the subsequent characters are Octal numbers.
Note: In Turbo C 2.0, the number range of the constant type is-128 to 127, unless you declare it as unsigned, so that it is 0 to 255.
The \ x, \ n, \ a, and so on we have seen above are all called escape characters, which tell the compiler to use special methods for processing.