int atexit(void (*pfnFunctionPtr)( void ));
#include <iostream> #include <cstdlib> void First() { std::cout << "1" << std::endl; } void Second() { std::cout << "2" << std::endl; } void Third() { std::cout << "3" << std::endl; } int main() { using namespace std; atexit(First); atexit(Second); atexit(Third); cout << "The functions are called when we return" << endl; cout << "and in reverse order." << endl; return 0; }
© 20072024 XoaX.net LLC. All rights reserved.