I have a 3D array: float input[2][50][1000];
I want to quick sort it from:
qsort (x, sizeof(x)/sizeof(*x), sizeof(*x), comp);
where comp is
int comp (const void * elem1, const void * elem2) {
float f = *((float*)elem1);
float s = *((float*)elem2);
if (f > s) return 1;
if (f < s) return -1;
return 0;
}
I just want to sort 1 dimension of my 3D array, i.e I want to sort input[0][temp][0], input[0][temp][1], input[0][temp][2] and so on.
Ques: What do I replace x with?
Forgive me if it sounds stupid
input[0][temp][0]..input[0][temp][999], is that correct ?item[0][temp]qsort()may sort using a different algorithm than "quick sort".