#include <iostream>
using namespace std;

void termin_func()
{
 cout << "自己处理未catch到的异常,可以在这里log出异常状况!!" << endl;

 system("pause");

 exit(0);
}

int _tmain(int argc, _TCHAR* argv[])
{
 /*Sleeper s;
 Watcher w;

 s.SleepFiveSecCallMe(w);
 w.RestFiveSec();*/

 set_terminate(termin_func);

 throw "故意抛出的异常!";

 system("pause");


 return 0;
}

相关文章:

  • 2021-08-24
  • 2022-12-23
  • 2022-02-19
  • 2021-11-08
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案