The escape character is literally understood to translate the meaning of the subsequent character.
Example: Commonly used escape characters
Hex and octal: \DDD:DDD is 3 contiguous 8 binary data So what he meant was to escape the characters in the back, meaning that instead of printing the DDD3 numbers directly, we printed the characters in the ASCII table, and DDD was actually the numbering in our ASCII table.
Octal notation: \xhh:hh represents two-bit 16 binary data, so what he means is to escape the two-bit hexadecimal data, showing the ASCII representation of the character graphic corresponding to the number.
Note that there is no decimal representation, but some are able to use decimal notation, for example, our-to-end character is an example.
Other escape characters apply: \ n \ \f \ \ \ \ etc
Because ' "\ These characters themselves are not only displayed as a character, but have some other characteristics, so we are here with the escape character to escape him, do not let it express this feature, but simply as a character to display.
It is important to note that the encoding in the ASCII encoding table and the corresponding character graphic, the encoding in the ASCII encoding table and the corresponding meaning
Why do you say that? Because there are actually some encodings in the ASCII encoding table that are capable of displaying characters, while others are not capable of displaying characters, they have a specific effect, such as our end-of-line character, \ n newline character ....
One issue that needs attention is also a knowledge point that is often learned: character numbers and true numbers
For example: ' 0 ' is a character number 0 is a real number
char a = ' 0 '; Char b = 0; So how does this make sense? When we give a number to a variable of type char, then he will think of that number as the encoded value in the ASCII table, so if we are a the case is that the character is displayed as 0 of the encoded value to a, that is, the decimal 48, and the encoded value of 0 to B.
When we use%d to print out is the corresponding encoding value, if you use%c to print out the corresponding character graphic display.
So here is the conversion formula involving a character number and a positive number: Character number-48 = true number
About escape characters in the C language