我希望 f 指向一个 f_pointer_type 数组。那么我在这里错过了什么?我收到一个错误“需要左值作为赋值的左操作数”。这是什么意思 ?
#include <stdio.h>
typedef char* (*f_pointer_type)();
char * retHello()
{
return "hello";
}
int main()
{
char (* ( *f())[])(); //Declare f to be a pointer to an array of pointers to function that gets nothing and return a char.
f_pointer_type funcs[3]; //an array of pointers to function that gets nothing and returns a pointer to char
f = &funcs; //ERROR : lvalue required as left operand of assignment
return 0;
}