What are carriage return, linefeed, and form feed?

后端 未结 12 1430
我寻月下人不归
我寻月下人不归 2020-11-22 14:26

What is the meaning of the following control characters:

  1. Carriage return

  2. Line feed

  3. Form feed

12条回答
  •  抹茶落季
    2020-11-22 15:11

    Consider an IBM 1403 impact printer. CR moved the print head to the start of the line, but did NOT advance the paper. This allowed for "overprinting", placing multiple lines of output on one line. Things like underlining were achieved this way, as was BOLD print. LF advanced the paper one line. If there was no CR, the next line would print as a staggered-step because LF didn't move the print head. FF advanced the paper to the next page. It typically also moved the print head to the start of the first line on the new page, but you might need CR for that. To be sure, most programmers coded CRFF instead of CRLF at the end of the last line on a page because an extra CR created by FF wouldn't matter.

提交回复
热议问题