我想创建一个函数指针数组并能够在 for 循环中调用它们。我怎样才能做到这一点?我试过了:
void (**a) (int);
a[0] = &my_func1;
a[1] = &my_func2;
a[2] = &my_func3;
for ( i = 0; i < 3; i++){
a[0]();
(*a[0])(); // Neither does work
}
但是我想我缺少一些语法:
error: too few arguments to function ‘*(a + (long unsigned int)((long unsigned int)i * 8ul))’