Okay, I just got to the "Pointers to Functions" section in this C book here, and it's somewhat confusing to me. Could anyone help me with this stuff? (a good website would be fine too =) The book gives a program as an example, and here are some parts of it:

Here is the function prototype of qsort:
Code:
void qsort(void *lineptr[], int left, int right,
           int (*comp)(void *, void *));
And here is the call to qsort:
Code:
qsort((void **) lineptr, 0, nlines-1,
  (int (*)(void*, void*))(numeric ? numcmp : strcmp));
Now, in the prototype, when do we know that the argument should be a function? Is it just when you have the argument parentheses next to a? Also, in that call, (the first three arguments are irrelevant, btw) how does that function casting work? Are the void*'s the same as "void *"?

Later in the chapter, it says that you have to use int (*comp)(void *, void *) instead of int *comp(void *, void *) because the second one would mean a function returning a pointer to an integer. So, how would you pass a function as an argument? (or did they mean that the second version just wouldn't work?)