We often make use of std::stringstream to convert values of various types into a single std::string. For example, see this:
Paul (at stackoverflow) was trying to think of a clever way to concatenate various things into a single string without having to use an ostringstream explicitly. He came up with a macro which he didn't like though.
std::stringstream ss; ss << 25 << " is greater than " << 5; std::string s = ss.str(); //s => "25 is greater than 5"
Paul (at stackoverflow) was trying to think of a clever way to concatenate various things into a single string without having to use an ostringstream explicitly. He came up with a macro which he didn't like though.