#include #include #include using namespace std; void my_new_handler(); const char *progname; //uninitialized variable inline void f() {cout << "f()\n";} int main(int argc, char **argv) { progname = argv[0]; set_new_handler(my_new_handler); cout << "How many pointers to functions do you want to allocate? "; size_t n; cin >> n; void (**const p)() = new (void (*[n])()); p[0] = f; (*p[0])(); //call f p[0](); //call f delete[] p; return EXIT_SUCCESS; } void my_new_handler() { cerr << progname << ": out of store\n"; exit(EXIT_FAILURE); }