I
istillshine
I called qsort (from standard library) somewhere in my function.
qsort(temp, tree_num, sizeof(int), compare);
I defined compare before the caller in the same .c file.
int compare(const int *a, const int *b)
{
int val1, val2;
val1 = *a;
val2 = *b;
return (val1 > val2) ? -1 : ((val1 < val2) ? 1 : 0);
}
When compiling, I got this warning:
passing arg 4 of `qsort' from incompatible pointer type
I really could not find out why compare is incompatible.
qsort(temp, tree_num, sizeof(int), compare);
I defined compare before the caller in the same .c file.
int compare(const int *a, const int *b)
{
int val1, val2;
val1 = *a;
val2 = *b;
return (val1 > val2) ? -1 : ((val1 < val2) ? 1 : 0);
}
When compiling, I got this warning:
passing arg 4 of `qsort' from incompatible pointer type
I really could not find out why compare is incompatible.