quick sort would be the way to go imho. You can use the built in qsort function but if you have troubles with the passing of function pointers you could always do a bubble sort. If the array size is always going to be small, you wont see that much of a performance difference. Bubble sort is the simplest sort that will traverse the array in the best case one time (array already sorted) or n-1 times in the worst case (n=# of elements; array sorted in reverse order)
Bubble sort works as follows
// n = # of elements
for(int x = 0;i<n-1;x++)
{
if(array[x]>array[x+])
{
int y = array[x];
array[x] = array[x+1];
array[x+1] = y;
}
}
This is the easiest to follow sorting algorithm and once you understand it, it can be modified to work quicker.
For each traversal of the array it moves the largest element to its proper position
Example
3,5,2,7,9,1 //start
3,2,5,7,1,9 //pass 1
2,3,5,1,7,9 //pass 2
2,3,1,5,7,9
2,1,3,5,7,9
1,2,3,5,7,9
Matt