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:
Code:
void Sort(float list[],
int length)
{
float temp;
int passCount;
int searchIndex;
for(passCount = 0; passCount<length-1; passCount++)
{
for(searchIndex=passCount+1; searchIndex<length;searchIndex++)
{
if(list[searchIndex] < list[passCount])
{
temp = list[passCount];
list[passCount] = list[searchIndex];
list[searchIndex] = temp;
}
}
}
sorted = true;
DisplayArray(list, length);
}
Also, there is a built in quicksort in c++. You may not be allowed to use this. It's callled qsort.
Signing off til tomorrow afternoon.