fork download
  1. #include <exception>
  2. #include <iostream>
  3. #include <stdexcept>
  4.  
  5. int main( void ){
  6. try {
  7. throw std::runtime_error( "x is 0" );
  8. }
  9. catch( std::exception & e) {
  10. std::cout << "yes!";
  11. } catch (...) {
  12. std::cout << "no!";
  13. }
  14.  
  15. }
Success #stdin #stdout 0.01s 2856KB
stdin
Standard input is empty
stdout
yes!