fork download
  1. #include <iostream>
  2. #include <exception>
  3. using namespace std;
  4.  
  5.  
  6. void ThrowAThing()
  7. {
  8. throw new exception();
  9. }
  10.  
  11. int main() {
  12. // your code goes here
  13. try
  14. {
  15. ThrowAThing();
  16. } catch(exception ex)
  17. {
  18. cout << ex.what() << endl;
  19. }
  20. return 0;
  21. }
Runtime error #stdin #stdout #stderr 0s 3224KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
terminate called after throwing an instance of 'std::exception*'