c++ - How can I copy value from ostringstream to string? -


i tried :

ostringstream oss; read string file , put oss; string str; str << oss.str();// error here "error: no match ‘operator>>’ in 'oss >> str' " 

if use str = oss.str(); instead of printing value of string, prints out "....0xbfad75c40xbfad75c40xbf...." likes memory address.
can tell me why? thank you.

string str = oss.str(); // should trick 

Comments

Popular posts from this blog

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -

mysql - How to insert just year and month into date field? -