#include #include using namespace std; int main() { stringstream stream1, stream2; double x = 1.29312, y; string a; // convert double into a string stream1 << x; // push double x into the stringstream stream1 >> a; // pull x out of the stringstream into a string cout << "String = " << a << endl; // print the string (NOT the stringstream) // convert string back to a double... need to use *new* stringstream stream2 << a; // push string onto stringstream stream2 >> y; cout << "Double = " << y << endl; return 0; }