Advertisement

Function Pointer question

Started by December 25, 2000 01:46 AM
1 comment, last by JoeDark 24 years ago
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

Advertisement
#define MAX 0
void (*func_ptr[MAX])();
or
typedef void (*t_func_ptr[MAX])();

This topic is closed to new replies.

Advertisement