What are carriage return, linefeed, and form feed?

后端 未结 12 1535
我寻月下人不归
我寻月下人不归 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:17

    Those are non-printing characters, relating to the concept of "new line". \n is linefeed. \r is carriage return. On different platforms they have different meanings, relative to a valid new line. In windows, a new line is \r\n. In linux, \n. In mac, \r.

    In practice, you put them in any string, and it will have effect on the print-out of the string.

提交回复
热议问题