fork download
  1. #include <iostream>
  2. #include <sstream>
  3. using namespace std;
  4.  
  5. int main() {
  6. stringstream convertor;
  7. int result = -1;
  8. convertor << std::noskipws << "";
  9. convertor >> result;
  10.  
  11. if (convertor.fail() || convertor.eof() == false)
  12. result = -1;
  13.  
  14. cout << "Result [" << result << "]" << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Result [-1]