title: Speed of output
body: <p>I am coding in C++.
  Let s be some string. I am asked to determine which of the following is faster:</p>
  
  <pre><code>cout &lt;&lt; "s:"  + s  + "s:"  + s  + " s:"  + s  + "\n";
  
  cout &lt;&lt; "s:" &lt;&lt; s &lt;&lt; "s:" &lt;&lt; s &lt;&lt; " s:" &lt;&lt; s &lt;&lt; "\n";
  </code></pre>
  
  <p>I ran both of them repeatedly to find that the second one is faster. I spent a while trying to figure out why. I think it is because in the first one, the string is first concatenated then output to the screen. But the second one just output straight to the screen. Is that correct?</p>