Function Pointer question
Just a quick question, the book I''m using doesn''t give an example. What''s the correct syntax for declaring an array of function pointers?
JoeDark
void test01() {/*...*/};void test02() {/*...*/};void test03{} {/*...*/};typedef void(*pf)();int main(int argc, char** argv, char** env){ pf pfn[3]; pfn[0] = test01; pfn[1] = test02; pfn[2] = test03; for(int idx = 0; idx < 3; idx++) { pfn[idx](); } return 0;}
One way, don''t know if it''s what your after
YAP-YFIO,
deadlinegrunt
~deadlinegrunt
December 25, 2000 03:50 AM
#define MAX 0
void (*func_ptr[MAX])();
or
typedef void (*t_func_ptr[MAX])();
void (*func_ptr[MAX])();
or
typedef void (*t_func_ptr[MAX])();
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement