Advertisement
frasl

Untitled

Mar 10th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. struct victim {
  2.     int a;
  3.  
  4.     ~victim()
  5.     {
  6.         std::cout << "victim dead" << std::endl;
  7.     }
  8. };
  9.  
  10. void fn()
  11. {
  12.     throw int(7);
  13. }
  14.  
  15.  
  16. int main()
  17. {
  18.     try {
  19.         victim vic;
  20.  
  21.         fn();
  22.     }
  23.     catch (const int &e)
  24.     {
  25.         std::cout << e;
  26.     }
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement