When i send to the serial a string that has \r\n , the serial is going down one row.
But what if i wants to send it as is , to some module and not going down a row ?
Vaclav:
FYI these (\r\n) are called “escape sequences” - carriage return and new line ( line feed)
Oldies but goodies.
FYI, “escape sequences” have an “ESC” (2710, 338 or 0x1b) character in them - carriage-return/line-feed are single characters and cannot therefore be described as “escape sequences”, they are simple control characters.
Certain characters can be represented in character and string constants by escape sequences like \n (newline);
It is called an escape sequence because the \ tells the compiler to stop treating the characters "normally" and treat them as special characters. i.e., it "escapes" the normal processing of characters. There is no char 27 in a typical newline, just the line feed or cr.
Fair enough - K&R probably hijacked standard telecoms jargon to include their usage.
(I come from a telecoms background, where the escape key's use pre-dates the C language by a good decade)