fork download
  1. #include <sstream>
  2.  
  3. bool foo(){
  4. std::stringstream ss("42");
  5. int i;
  6. return ss >> i;
  7. }
  8.  
  9. int main() {}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'bool foo()':
prog.cpp:6:15: error: cannot convert 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' to 'bool' in return
  return ss >> i;
               ^
stdout
Standard output is empty