qsort: Cast the comparator function itself or the parameters in the body of comparator function?
You should avoid the latter case because it’s not valid. For two function types to be compatible, the return types must be compatible and the corresponding parameter types must be compatible. A const void * is not compatible with a const double * therefore the function types are not compatible. Calling a function through an … Read more