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++ эксперт
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
atexit: causes the function pointed to by func to be called upon normal program termination
//Declaration: int atexit(void (*func)(void));
//Return: returns zero if the function is successfully registered as a termination function and nonzero otherwise.
#include <stdlib.h>
#include <stdio.h>
void done(void);
int main(void)
{
if(atexit(done)){
printf("Error in atexit().");
}
return 0;
}
void done(void)
{
printf("Hello There");
}
/*
Hello There*/