fork download
  1. #include <stdexcept>
  2. #include <iostream>
  3.  
  4. void myfunc()
  5. {
  6. throw std::runtime_error("is uncatchable");
  7. }
  8.  
  9. int main()
  10. {
  11. try { myfunc(); }
  12. catch (std::exception const& ex) { std::cout << "handled: " << ex.what() << std::endl; }
  13. catch (...) { std::cout << "something else..." << std::endl; }
  14. }
  15.  
  16.  
Success #stdin #stdout 0s 4488KB
stdin
Standard input is empty
stdout
handled: is uncatchable