Reputation: 63200
Is there a conversion for the above?
Upvotes: 9
Views: 10717
Reputation: 39208
Convert a std::string
to an output stream? Usually it's: convert a string to an input stream that reads characters from the given string:
std::string myString = //...
std::istringstream iss(myString);
See also: http://www.cplusplus.com/reference/iostream/istringstream/
Upvotes: 18
Reputation: 23217
std::ostringstream
from <sstream>:
http://www.cplusplus.com/reference/iostream/ostringstream/
Upvotes: 6