Reputation: 117
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.
Upvotes: 1
Views: 141
Reputation: 896
You can also use:
std::cout << '\n';
The only difference is that the stream won't be flushed.
Upvotes: 2
Reputation: 1
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.
Upvotes: 2