#include
using std::cout;
using std::endl;
#include
using std::string;
#include
using std::ostringstream;
int main()
{
ostringstream outputString;
string string1( "string " );
double double1 = 123.4567;
int integer = 22;
outputString << string1 << double1 << integer << &integer;
// call str to obtain string contents of the ostringstream
cout << "outputString contains:\n" << outputString.str();
return 0;
}
outputString contains:
string 123.457220x22fe74"