fork download
  1. #include <exception>
  2. #include <stdexcept>
  3. #include <iostream>
  4.  
  5. void my_terminate_handler()
  6. {
  7. std::cerr << "Terminate handler" << std::endl;
  8. }
  9.  
  10. int main()
  11. {
  12. std::set_terminate(my_terminate_handler);
  13.  
  14. throw "cake";
  15. }
Runtime error #stdin #stdout #stderr 0s 3224KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Terminate handler