 #include <iostream>
 #include <fstream>
 #include <string>
 
 using namespace std;
 
 int main(int argc, char *argv[])
 {
   fstream sout;
   sout.open("non_existent_file", ios::in); // failbet should be set, isn't
   cout << sout.rdstate(); return 0;
 }
 