I wrote my comparison function
int cmp(const int * a,const int * b) { if (*a==*b) return 0; else if (*a < *b) return -1; else return 1; }
and i have my ad
int cmp (const int * value1,const int * value2);
and I call qsort in my program like this
qsort(currentCases,round,sizeof(int),cmp);
when i compile it i get the following warning
warning: passing argument 4 of 'qsort' from incompatible pointer type /usr/include/stdlib.h:710: note: expected '__compar_fn_t' but argument is of type 'int (*)(const int *, const int *)'
The program works just fine, so my only problem is why she doesn't like how she uses it?
source share