fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char *argv[])
  8. {
  9. fstream sout;
  10. sout.open("non_existent_file", ios::in); // failbet should be set, isn't
  11. cout << sout.rdstate(); return 0;
  12. }
  13.  
Success #stdin #stdout 0s 3020KB
stdin
Standard input is empty
stdout
4