title: How to clear ostringstream
body: <pre>
      ostringstream s;
  
      s &lt;&lt; "123";
      cout &lt;&lt; s.str().c_str() &lt;&lt; endl;
  
      // how to clear ostringstream here?
      s &lt;&lt; "456";
      cout &lt;&lt; s.str().c_str() &lt;&lt; endl;
  </pre>
  
  <p>Output is:</p>
  
  <pre>
  123
  123456
  </pre>
  
  <p>I need:</p>
  
  <pre>
  123
  456
  </pre>
  
  <p>How can I reset ostringstream to get desired output?</p>