endl or \n is one better then the other?

I want to force myself into using the more "excepted" line advance.

Is there any advantage of one over the other? Maybe one used more in real world programing? One a old version one newer?

Could someone with a good amount of experience shed some light on this minor mystery? :)

Thanks in advance!
There's only one difference:

cout << endl;

is the same as

cout << '\n' << flush;

Typically you don't want to flush at every output, but save it for the end. So if you are writing a lot of lines at once, use '\n'. Otherwise it doesn't really matter.

Hope this helps.
Thanks Duoas, That is good information to know.
Topic archived. No new replies allowed.