Is there any difference between an array of pointer to function and an array of function pointers in c. please give an example of each
1 Answer
No, as a function pointer is a pointer to a function.
typedef int (*Pf)(int); /* This defines a type to hold the addrese of int foo(int). */
Pf pfs[42]; /* Declares an array of the above. */
A possible reason for possible irritation is that
pfs[0] = foo;
and
pfs[1] = &foo;
result in the same value for pfs[0] and pfs[1].