0x0 a line feed with \ n ASCII
\ R: ASCII 0x0d press ENTER
In windows, when you press enter, it will automatically become \ r \ n
In linux, the Enter key only represents \ n
In windows, the Return key is \ r \ n.
\ N is to enter the next line, \ r is the print header and return to the first line
In linux/unix, only \ n is used. It indicates carriage return + line feed.
In windows, \ r Only returns a carriage return without line breaks. \ n is a line break, but in some edits, a separate \ n does not wrap a line (such as notepad)
Generally, \ n can be written in a program. In linux or windows, the carriage return + line feed function can be implemented. (In a text file, linux only has 0x0a, windows will automatically change to 0x0d 0x0a)
Example: www.2cto.com
# Include <stdio. h>
Int main ()
{
Char a [10] = "abc \ r ";
Printf ();
Return 0;
}
The program runs without any output.
The reason is that \ r press ENTER indicates that the print header is returned to the starting position of the row, thus overwriting abc, so there is no output on the console!
From Jiang Yafeng's CSDN blog