You pass the same comparator as you got from the caller (fcmp
):
genmyqsort(a*size, pivot, size, fcmp);
genmyqsort(a+(pivot+1)*size, n-pivot-1, size, fcmp);
This will ensure that all instances of genmyqsort()
in the call tree will compare array elements in exactly the same way.