How do you declare a const array of function pointers?

后端 未结 5 1034
忘了有多久
忘了有多久 2021-01-11 11:34

Firstly, I\'ve got functions like this.

void func1();
void func2();
void func3();

Then I create my typedef for the array:

v         


        
5条回答
  •  暖寄归人
    2021-01-11 11:49

        typedef void (*FPTR)();
    
    FPTR const fa[] = { f1, f2};
    // fa[1] = f2;  You get compilation error when uncomment this line.
    

提交回复
热议问题