Alex Rivera | Logout

What are carriage return, linefeed, and form feed?

Asked 2010-06-22T08:40:31.090
700

What is the meaning of the following control characters:

  1. Carriage return

  2. Line feed

  3. Form feed

Edit
Report

1 Answer

2

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.

answered 2010-06-22T08:46:43.983

Your Answer