I believe that for people with basic computer operation knowledge, when they are doing text editing, when they need to wrap lines manually, they will naturally hit the enter key to let the cursor jump to the next line. However, the line wrapping operation that can be easily completed in the text editing software is a brain-breaking operation in the program design, because everything in the program is data, and what kind of data should be used to describe the line break?
In order to describe the functions of the similar line break operation, the ASCII code is specially designed with a batch of control characters, among which the control character corresponding to the line break operation is lf; However, these characters cannot be used directly in **, for example, in output statements; Therefore, in order to allow the functional control to be used in the output statement, the designers of programming languages such as C have specially designed a setEscape characters
Typically, an escape character has two ASCII code characters, the first character is fixed as a backslash " and the second character indicates a specific function, and the available escape characters are as follows:
Since the backslash is given a special task in the program to enable the escape operation, the backslash is printed at the time of outputYou have to knock in two backslash symbols。As you can see from the figure above, "x" is a legal escape characterOutputs data in hexadecimal form
In addition, escape characters are not limited to backslashes, which are represented by "&" in HTML.
How are escape characters, including "x", used in C? Answer:Used when outgoing data。Out-of-the-box output, on the other hand, includes both the common on-screen rendering, the writing to a file, and the control of the printer's printing.
Since printers aren't everyone's owned, it's common for C to render and write to files on the screen. For example, to render characters on the screen, escape characters can be used as follows.
In C, a backslash is only escaped if it appears in a double-quoted string.