#include <iostream>
#include <sstream>
using namespace std;
int main()
{
char ch;
ostringstream strout;
strout << 10 << " " << -20 << " " << 30.2 << "\n";
strout << "This is a test.";
cout << strout.str() << endl;
strout << "\nThis is some more output.\n";
istringstream strin(strout.str());
do {
ch = strin.get();
if(!strin.eof()) cout << ch;
} while(!strin.eof());
cout << endl;
}
|