PRODUCT : C++ NUMBER : 801 VERSION : All OS : DOS DATE : October 19, 1993 PAGE : 1/1 TITLE : Defining and Using Arrays of Pointers to Functions The following demonstrates how to define and initailize an array of pointers to functions. In addition, calling a function whose pointer is contained in such an array is demonstrated. #include void (*p[5])(); // p is defined to be an array of // 5 pointers to functions taking // no (void) paramaters and returning // nothing (void) void foo1(void) { printf("Hello, in function foo1\n"); } void foo2(void) { printf("Hello, in function foo2\n"); } main() { p[0]=foo1; // Assign pointer at array index 0 // to point at function foo1. p[0](); // Now call foo1 p[1]=foo2; // Assign pointer at array index 1 // to point to function foo2. p[1](); // Now call foo2 } DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.