set_terminate function is not working for me
问题 I have the following code taken from cplusplus.com: // set_terminate example #include <iostream> #include <exception> #include <cstdlib> using namespace std; void myterminate () { cout << "terminate handler called\n"; abort(); // forces abnormal termination } int main (void) { set_terminate (myterminate); throw 0; // unhandled exception: calls terminate handler return 0; } As there is unhandled exception in the code, it needs to call myterminate() function which is set as terminate handler