If I have an array A and an Array B, is there a way to use qsort() to sort array A and, at the same time, sort all the elements of B according to the elements of A? For example, if A = { 4, 3 ,2, 1} and B = {1, 2, 3, 4}, then after the sorting they are like this:
A = {1, 2, 3, 4} and B = {4, 3, 2, 1}