Note that normally you don't need to do this with with qsort(). In this case what is provided as an argument is not simply a function pointer but a complete conditional expression. The cast is simply telling the compiler to don't mind this and just trust that you know what you are doing. Without all this you should be able to call qsort() like this, (for an array of ints, length 10).
Code:
int comp(const void* a, const void *b) {
return *((int*)a) - *((int*)b);
}
int main()
{
int vect[10] = {4,2,3,7,1,3,5,2,8,1};
qsort(vect, 10, sizeof(int), comp);
return 0;
}