The question was about ostream for a string, not ostringstream for a string.
For those interested in answering the actual question ( ostream specific), try the following:
void someFunc(std::ostream out) { std::stringstream ss; ss << out.rdbuf(); std::string myString = ss.str(); }
Foo Jul 22 '13 at 21:34 2013-07-22 21:34
source share