我想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;
}
的功能? f_pointer_type ** f; - –
我猜f被解釋爲一些瘋狂的函數前向聲明。 –