LINE FEED AND CARRIAGE RETURN
Line Feed and Carriage Return Explained Line Feed and Carriage Return Explained We all know what a line feed is \n and what a carriage return character is \r . But most of us do not know why we have these two different characters to represent a new line. What does each of them really mean? To start with, these are an emulation of how line ending is handled in a traditional typewriter (hey, I actually worked on one of these :)). Line Feed is the act of moving the cursor exactly one row down, staying at the current column. In a typewriter, this is rolling the page one row up without moving the platen horizontally. Carriage Return is the act of moving the cursor to the beginning of the line, staying on the current row. In a typewriter, this is moving the platen to the right horizontally without rolling the page. The above operation, when done in succession, will make the typing head point to the beginning of the next line...