1 #include <iostream> 2 3 4 class ex { 5 }; 6 7 void f(void) { 8 throw ex(); 9 } 10 11 int main() { 12 try { 13 f(); 14 } 15 catch (const ex & myex) { 16 std::cout << "Catching..." << std::endl; 17 exit(0); 18 } 19 exit(1); 20 } 21