Why don't you need to pass arguments to a qsort comparator function?
问题 Code below taken from here. * qsort example */ #include <stdio.h> #include <stdlib.h> int values[] = { 40, 10, 100, 90, 20, 25 }; int compare (const void * a, const void * b) { return ( *(int*)a - *(int*)b ); } int main () { int n; qsort (values, 6, sizeof(int), compare); for (n=0; n<6; n++) printf ("%d ",values[n]); return 0; } We have a compare function with parameters in its signature but when we call it in qsort no arguments are passed. How are the values of a and b passed to the function