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
Post a Comment