C++ Tutorial/Development/set terminate


Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
Материал из C\C++ эксперт
Версия от 10:28, 25 мая 2010; Admin (обсуждение | вклад) (1 версия: Импорт контента...)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Set a new terminate handler

#include <iostream>
#include <cstdlib>
#include <exception>
using namespace std;
void my_Thandler() {
  cout << "Inside new terminate handler\n";
  abort();
}
int main()
{
  set_terminate(my_Thandler);
  throw 100; // throw an error
  return 0;
}
Inside new terminate handler
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application"s support team for more information.