1

One way to move on next line is cout << endl; I know there is another way to move on next line. But, I do not know what is that. Can anyone tell me.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
Student28
  • 117
  • 1
  • 1
  • 10

2 Answers2

2

You can write

std::cout << '\n';

instead. That would have the advantage that the stream isn't flushed at the same time.


Note:
On Windows OS it might be required to write

std::cout << '\r' << '\n';

or

std::cout << "\r\n";

to get correct line endings.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
2

You can also use:

std::cout << '\n';

The only difference is that the stream won't be flushed.

RoiHatam
  • 876
  • 10
  • 19