I'm learning C by reading K&R and got stuck in some codes from page 119 and 120. I pick up those codes that are confusing me.
char *line[MAXLINES];
Declaration:
void qsort(void *v[], int left, int right, int (*comp)(void *, void *))
caller:
qsort((void **) lineptr, 0, nlines-1, (int (*)(void*, void*))(numeric ? numcmp : strcpm));
As the declaration said, the first argument should be a array of pointer. However that's what exactly the lineptr is. So why do we need to add (void **) and what does that mean?
Another question is about the format, (int (*)(void*, void*))(numeric ? numcmp : strcpm), why is there only a single asterisk within parentheses?
Why can the (int (*)(void*, void*)) be followed by a function?
I searched on Google and try to find such format from tutorials, but I failed. So might anyone explain it? I'll really appreciate your help!!