+ 8
'\n' is faster.
"endl" flushes the buffer.
+ 4
https://www.sololearn.com/discuss/942217/?ref=app
https://www.sololearn.com/discuss/127013/?ref=app
https://www.sololearn.com/discuss/242949/?ref=app
https://www.sololearn.com/discuss/1111250/?ref=app
https://www.sololearn.com/discuss/79124/?ref=app
https://www.sololearn.com/discuss/1390849/?ref=app
+ 3
both are used to change lines..
\n is faster as Ben already pointed out..
other diff is their syntax
+ 2
Tharuke They're actually different. See my comment above.
+ 1
new line
+ 1
jonathan ishak No don't do that they both have different use cases
0
both are used in same context where u need new line...
bt \n is much faster
0
Under what circumstances do I need to consider using endl to flush the buffer?
- 1
just to go in new line
- 1
just know both and try using the one which u are comfortable with.



