fork download
  1. #include <iostream>
  2. #include <sstream>
  3.  
  4. int main ()
  5. {
  6. std::ostringstream foo;
  7. double pi = 3.141592653589793;
  8. foo.precision( 10 );
  9. foo << pi;
  10. std::cout << foo.str() << std::endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
3.141592654