Difference between \n and \r ?
I''ve read about \n and \r in a book I have and I know \n writes the newline character and \r is for a carriage return, but I don''t really know what the difference between the two. Don''t they both just cause the cursor position to go to the start of the next line?
That goes back to the days of typewriters:
Carriage Return (\r) brings the "carriage" (the thing that types) to the beginning of the current line
Line Feed (\n) feeds the page one line down, but does not touch the carriage, so it will stay in the same place, but one line lower.
Carriage Return (\r) brings the "carriage" (the thing that types) to the beginning of the current line
Line Feed (\n) feeds the page one line down, but does not touch the carriage, so it will stay in the same place, but one line lower.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement