title: how to correctly use stringstream class multiple times
body: <p>Stringstream is very convenient in C++ to convert between strings and other num types. I am trying to use a stringstream multiple times in a program like this.</p>
  
  <pre><code>stringstream ss;
  string s1="stack",s2="overflow";
  string s3,s4;
  ss&lt;&lt;s1;
  ss&gt;&gt;s3;
  ss.str("");  
  cout&lt;&lt;s3&lt;&lt;endl;
  
  ss&lt;&lt;s2;
  ss&gt;&gt;s4;
  cout&lt;&lt;s4&lt;&lt;endl;
  </code></pre>
  
  <p>The program will correctly output "stack", but will not output "overflow". Any explanations for that?</p>