fork(1) download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4. #include <sstream>
  5.  
  6. int main()
  7. {
  8. char doubleStr[] = "5.2";
  9. double d = 0.0;
  10. std::stringstream stream (doubleStr);
  11. stream >> std::fixed >> d;
  12. std::cout << d << std::endl;
  13. std::cout << (d <= 5.2);
  14. return 0;
  15. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
5.2
1