fork(2) download
  1. #include <iostream>
  2. #include <sstream>
  3. using namespace std;
  4.  
  5. int main () {
  6.  
  7. float val =31511.4424;
  8. stringstream ss (stringstream::in | stringstream::out);
  9.  
  10. ss << val;
  11.  
  12. string test = ss.str();
  13.  
  14. cout << test <<endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
31511.4