Advertisement
Josif_tepe

Untitled

May 12th, 2021
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int x = -1;
  7.     cout << "Pred try-catch" << endl;
  8.    
  9.     try {
  10.         cout << "Inside try" << endl;
  11.         if(x < 0) {
  12.             throw "123";
  13.             cout << "Posle frlanje(ne treba da se pecati" << endl;
  14.         }
  15.     }
  16.     catch(const char *a) {
  17.         cout << a << endl;
  18.     }
  19.     cout << "Posle try-catch" << endl;
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement