fork download
  1. #include <iostream>
  2. #include <exception>
  3.  
  4. void myterminate () {
  5. std::cerr << "termninate called\n";
  6. throw 0;
  7. }
  8.  
  9. int main (void) {
  10. std::set_terminate(myterminate);
  11. try
  12. {
  13. throw 'x';
  14. }
  15. catch (char) { std::cerr << "caught char\n"; }
  16. }
Success #stdin #stdout #stderr 0s 3424KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
caught char