fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. try
  9. {
  10. throw - 1;
  11. }
  12. catch (int x)
  13. {
  14. cerr << "We caught: " << x << endl;
  15. }
  16. catch (const string &name)
  17. {
  18. cerr << "We caught: " << name << endl;
  19. }
  20.  
  21. return 0;
  22. }
Success #stdin #stdout #stderr 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
We caught: -1