+ 2
What is the best practice for new line in C++ endl or \n ?
4 Antworten
+ 2
endl flushes out any memory resources left out during the execution while \n doesn't. therefore, endl is a little slower than \n.
usually you'll use endl, however, if the execution speed matters like in competitive coding, you'll want to use \n.
+ 1
thanks to everyone
0
\n
0
"\n" easy
<< end