#include using namespace std; void Xhandler(int test) { try { if (test==0)throw test; if (test==1)throw 'a'; if (test==2)throw 1233.33; } catch(int i){ cout << "caught " << i << '\n'; } catch(...) { cout << "caught default\n"; } } int main(int argc, char* argv[]) { Xhandler(0); Xhandler(1); Xhandler(2); return 0; } // catch is a signal handler // throw is kill // try is signal