0
what is the difference between endl and \n
6 Answers
+ 4
Yes, they're different.
"\n" is just a string of length 1 that gets appended to stdout.
std::endl, instead, is an object that will cause to append the newline character ("\n") AND to flush stdout buffer. For this reason it will take more processing.
+ 1
ohh
0
they are same
0
mmm
0
\n is an a new line
endl is an a end line
0
\n is an a new line
endl is an a end line