c - pointer to an array of pointer to functions -
i f point array of f_pointer_type. did miss here ? i'm getting error 'lvalue required left operand of assignment'. mean ?
#include <stdio.h> typedef char* (*f_pointer_type)(); char * rethello() { return "hello"; } int main() { char (* ( *f())[])(); //declare f pointer array of pointers function gets nothing , return char. f_pointer_type funcs[3]; //an array of pointers function gets nothing , returns pointer char f = &funcs; //error : lvalue required left operand of assignment return 0; }
if read clockwise/spiral rule see f
function returning pointer array of pointers functions returning char*
. in other words it's function prototype , not variable declaration.
try instead:
f_pointer_type (*f)[];
Comments
Post a Comment