fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. try
  7. {
  8. try
  9. {
  10. throw 20;
  11. }
  12. catch (int n)
  13. {
  14. cout << "Inner Catch\n";
  15. throw;
  16. }
  17. }
  18. catch (int x)
  19. {
  20. cout << "Outer Catch\n"<<x;
  21. }
  22. catch (...)
  23. {
  24. cout << "Outer ... Catch\n";
  25. }
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 5488KB
stdin
2600
stdout
Inner Catch
Outer Catch
20