fork download
  1. #include <iostream>
  2. #include <typeinfo>
  3. int main()
  4. {
  5. try {
  6. throw range_error("ERROR");
  7. }
  8. catch(std::logic_error const& x) {
  9. std::cout << "A-" << x.what();
  10. }
  11. catch(std::exception const & x) {
  12. std::cout << "B-" << x.what();
  13. }
  14. catch(...) {
  15. std::cout << "C";
  16. }
  17. std::cout << "-DONE" << std::endl;
  18. return 0;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:6: error: ‘range_error’ was not declared in this scope
prog.cpp:8: error: expected type-specifier
prog.cpp:8: error: expected unqualified-id before ‘const’
prog.cpp:8: error: expected `)' before ‘const’
prog.cpp:8: error: expected `{' before ‘const’
prog.cpp:8: error: expected initializer before ‘)’ token
prog.cpp:11: error: expected primary-expression before ‘catch’
prog.cpp:11: error: expected `;' before ‘catch’
prog.cpp:14: error: expected primary-expression before ‘catch’
prog.cpp:14: error: expected `;' before ‘catch’
stdout
Standard output is empty