How can I copy value from ostringstream to string?
<p>I tried :</p>

<pre><code>ostringstream oss;
read a string from file and put to oss;
string str;
str &lt;&lt; oss.str();// error here "error: no match for ‘operator&gt;&gt;’ in 'oss &gt;&gt; str' "
</code></pre>

<p>If I use <code>str = oss.str();</code>
Instead of printing the value of the string, it prints out <code>"....0xbfad75c40xbfad75c40xbf...."</code> likes memory address.<br/>
Can anybody tell me why?
Thank you.</p>
