#include <iostream> #include <iomanip> #include <string> #include <sstream> using namespace std; int main( ) { stringstream ss; ss << "string " << 9 << 1.2; cout << ss.str( ) << endl; // stringstream::str( ) returns a string }
string 91.2