Code block of try...catch : try catch « Language « C++
- C++
- Language
- try catch
Code block of try...catch
#include <iostream>
using namespace std;
int main(void){
cout << "Start" << endl;
try {
cout << "Inside try block." << endl;
cout << "Still inside try block." << endl;
}catch(int i){
cout << "Caught an exception--value is: " << endl;
cout << i << endl;
}
cout << "End";
}
Related examples in the same category