Morris Keesan
3/25/2011 3:36:00 AM
On Thu, 24 Mar 2011 16:08:34 -0400, merlin100 <aceman500@gmail.com> wrote:
> Ok I have an array of pointers to functions that return int and take
> void like:
>
> int (*funcsP[])(void) = {func_a, func_b};
>
> Now I want to create a pointer to that array and I can't figure out
> the correct "incantation" :)
Rather than giving yourself headaches trying to deal with C's messy
syntax for function pointers, consider using a typedef:
typedef int (*funcp)(void); /* funcp is ptr to func(void) returning int */
funcp funcsP[] = {func_a, func_b};
funcp *funcp_ptr = funcsP;
/* Or equivalently, funcp *funcp_ptr = &funcsP[0]; */
--
Morris Keesan -- mkeesan@post.harvard.edu