Home Segments Index Top Previous Next

585: Mainline

Note that the character string contains the character pair \n. When such a character pair appears in a printf statement, the effect is to terminate the current line and to start a new one.

You can also use \n in character strings you display with the output operator, <<.

Most programmers prefer to use endl to terminate lines, rather than \n, because endl not only terminates lines, but also directs your computer to complete the delivery to your screen of all the characters that have accumulated in an output buffer. Thus, << is said to flush the output buffer.