Possible Duplicate:
Casting a function pointer to another type
int primes[] = {11, 5, 3, 7, 19, 13, 2, 17};
int comp(const int*, const int*);
qsort(primes, 8, sizeof(int), (int(*)(const void*, const void*))comp);
Is the cast in the third line legal? Or must comp
take const void*
arguments and do the cast inside?