Code /* testSstream.cpp CIS 250 Dave Klick 2017-01-15 Demonstrates simple use of stringstream. */ #include // for stringstream #include // for EXIT_SUCCESS #include // for cout, fixed, showpoint #include // for setprecision int main(int argc, char* argv[]) { using std::stringstream; stringstream strm; double x = 1.477; strm << "The value of x is " << std::fixed << std::showpoint << std::setprecision(2) << x << std::endl; // Convert stringstream to C++ string and display std::cout << strm.str(); return EXIT_SUCCESS; } /* Displays: The value of x is 1.48 */