What is the difference between these two statements:
void (*p) (void *a[],int n)
and
void *(*p[]) (void *a, int n)
$ cdecl void (*p) (void *a[],int n); declare p as pointer to function that expects (a as array of pointer to void, n as int) returning void; void *(*p[]) (void *a, int n); declare p as array of pointer to function that expects (a as pointer to void, n as int) returning pointer to void;
there is beautiful way of comprehending such type of complex declaration in Expert_C_Programming_Deep_C_Secrets_by_Peter_van_der_Linden on page 71.
According to him :
Declarations in c are boustrophedonically, i.e alternating right-to-left with left-to-right. Have a look at this snapshot

The ebook is available on google if you know how to download it.
void (*p) (void *a[],int n) p is the variable name. Remove p from the above line void ( * )(void *a[],int n) . So p is of this type. This is a pointer of a function. So p is a pointer to the function with that signature. So p is a pointer to a function which return void and takes array of 'void pointers' and int as the parameter.
void *(*p[]) (void *a, int n) [] has more precedence than *. So p is an array. remove p[] the above. So p is an array of void( * )(void *a[],int n)
So here p is an array of pointers to function which return void and takes array of 'void pointers' and int as the parameter.
explainin front of it, and remove the names of the arguments (a practice I do with function pointers anyway, but which C should normally parse perfectly fine). cdecl doesn't like them for no good reason I know of, but will give you the right answer if you take them out.