 <p><code>std::endl</code> calls <code>flush</code> stream while <code>cout &lt;&lt; "\n"</code> does not flush the stream, so <code>cout &lt;&lt; "\n";</code> gain better performance, especially while you call it in loop.</p> <p>§27.7.3.8 <strong>Standard basic_ostream manipulators</strong></p> <pre><code>namespace std { template &lt;class charT, class traits&gt; basic_ostream&lt;charT,traits&gt;&amp; endl(basic_ostream&lt;charT,traits&gt;&amp; os); } 1 Effects: Calls os.put(os.widen(’\n’)), then os.flush(). </code></pre>