Possible Duplicate:
What is the difference between \r and \n?
I understand that it's different for each operating System, for example, "\r\n" may be expected in Windows, "\n" may be expected in Unix snd "\r" may be expected in Macs.
What are the differences between these two (or three, if you want to include "\r\n") escape sequences? Why isn't it consistent across all systems?
I'm curious about this.
Because it just isn't.
\r means "carriage return".
\n means "new line" line feed
Some systems are wise enough to suggest that all they need to get the cursor to a new line is \n
. Others think that it's more appropriate to go \r\n
, because, they may claim that the column position needs to be reset as well (i.e. the \r
).
Sometimes in computing things are 'just this way'. This is one of those cases :)