What is the difference between a “line feed” and a “carriage return”?

后端 未结 3 1528
小蘑菇
小蘑菇 2020-11-28 00:36

If there are these two keywords then they must have their own meaning. So I want to know what makes them different and what is their code?

3条回答
  •  情书的邮戳
    2020-11-28 00:54

    Both of these are primary from the old printing days.

    Carriage return is from the days of the teletype printers/old typewriters, where literally the carriage would return to the next line, and push the paper up. This is what we now call \r.

    Line feed LF signals the end of the line, it signals that the line has ended - but doesn't move the cursor to the next line. In other words, it doesn't "return" the cursor/printer head to the next line.

    For more sundry details, the mighty wikipedia to the rescue.

提交回复
热议问题