How do you declare a const array of function pointers?

后端 未结 5 1059
忘了有多久
忘了有多久 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条回答
  •  萌比男神i
    2021-01-11 11:59

    If you want the array itself to be const:

    FP const a[] =
        {
            func1,
            func2,
            func3
        };
    

提交回复
热议问题