According to the documentation qsort is supposed to be used like:
std::qsort(a, size, sizeof *a, [](const void* a, const void* b)
{
if(*a < *b) return -1;
if(*a> *a) return 1;
return 0;
});
If the values are the same and I don't mind which comes first, or I prefer one to come before the other based on some other variable, can I do?
if(*a < *b) return -1;
else return 1;