// test the throw #include<iostream> using namespace std; void func() { cout << "generate exception" << endl; throw 5; } int main() { try{ func(); } catch(int value) { cout << "accept exception " << endl; } return 0; }