title: cout partially print without endl
body: <p>I'm printing a bunch of strings as following:</p>
  
  <pre><code>cout&lt;&lt;count&lt;&lt;"|"&lt;&lt;newTime.time&lt;&lt;"|"&lt;&lt;newCat&lt;&lt;"|"&lt;&lt;newCon&lt;&lt;endl;
  </code></pre>
  
  <p>in which count is a counter, newTime.time is a string of time, and newCat and newCon are both strings.
  The output is like following:</p>
  
  <pre><code>06:02:11:20:08|DB Mgr|Sending query: “SELECT * FROM users” 
  </code></pre>
  
  <p>Apparently, it left out the count and "|". However, if I change the code into</p>
  
  <pre><code>cout&lt;&lt;count&lt;&lt;"|"&lt;&lt;endl;
  cout&lt;&lt;newTime.time&lt;&lt;"|"&lt;&lt;newCat&lt;&lt;"|"&lt;&lt;newCon&lt;&lt;endl;
  </code></pre>
  
  <p>The output just turned into</p>
  
  <pre><code>2|
  06:02:11:20:08|DB Mgr|Sending query: “SELECT * FROM users” 
  </code></pre>
  
  <p>I was first thinking if this is the problem of buffer. I changed endl to flush but the problem still exists.
  Thanks for any help.</p>