title: Please help me to understand the difference between streambuf, stringbuf and stringstream?
body: <p>Please someone help me to undersatnd the difference between " streambuf, stringbuf and stringstream". </p>
  
  <pre><code>void f1(std::string const&amp; text)
  {
       std::stringstream           inStream(text);
      cout&lt;&lt;inStream.str()&lt;&lt;endl;
   }
  </code></pre>
  
  <p>or if I write</p>
  
  <pre><code>void f2(std::string const&amp; text)
  {
      std::stringbuf           inStream(text);
      cout&lt;&lt;inStream.str()&lt;&lt;endl;
   }
  </code></pre>
  
  <p>Both shows the same result. When should I use stringbuf or stringstream? Thanks in advance.</p>