fork download
  1. #include <fstream>
  2. #include <iostream>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. std::ifstream f;
  7. f.exceptions(std::ios_base::failbit);
  8. try {
  9. f.clear(std::ios_base::failbit);
  10. } catch (std::ios_base::failure& e) {
  11. std::clog << "It will never be catched :-) Hahaha :-)" << std::endl;
  12. }
  13. return 0;
  14. }
Success #stdin #stdout #stderr 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
It will never be catched :-) Hahaha :-)