I don't know what kind of sort you are using. The only one I know is the bubble sort. If you can use the bubble sort, I think this will work:
Also, there is a built in quicksort in c++. You may not be allowed to use this. It's callled qsort.
void Sort(float list,
for(passCount = 0; passCount<length-1; passCount++)
if(list[searchIndex] < list[passCount])
temp = list[passCount];
list[passCount] = list[searchIndex];
list[searchIndex] = temp;
sorted = true;
Signing off til tomorrow afternoon.