Here is a trivial example:
std::string my_string; std::ostringstream my_ostringstream( std::stringstream::in | std::stringstream::out ); my_ostringstream << "Total: " << total; my_string = my_ostringstream.str(); std::cout << my_string << std::endl;
std::string my_string; std::ostringstream my_ostringstream( std::stringstream::in | std::stringstream::out ); my_ostringstream << "Total: " << total; my_string = my_ostringstream.str(); std::cout << my_string << std::endl;
No comments:
Post a Comment