+ 1
Difference between \n and \r.
"hello\na" and "hello\ra" gives same output. Explain in terms of output and what does carriage return means.
5 ответов
+ 4
\n = newline
\r = carriage return
+ 3
Ok the result on your screen is the same..
But you should know that this is derived from the printing system.. Think about dot matrix printers (or a typewriter) where the \n command (new line) goes to the new line moving down the roll without changing the position of the head. The \r command (carriage return) moves the head to the first position of the line.
In the MsDos based systems in text files the newline is composed by \x0D and \x0A that is the same as \r + \n (in this order). Instead in Unix based system the new line is composed only by \x0A (\n).
+ 2
In c use only \n
+ 1
so, there is no difference between \n and \r in new compilers #michael isac Girardi
+ 1
can you answer another post of mine about backspace #Girardi