array? pure c++ or an qt container?

have a look at qMin, qMax (with a loop) or qSort:
void qSort ( RandomAccessIterator begin, RandomAccessIterator end )
Sorts the items in range [begin, end) in ascending order using the quicksort algorithm.
Example:
Qt Code:
  1. QList<int> list;
  2. list << 33 << 12 << 68 << 6 << 12;
  3. qSort(list.begin(), list.end());
  4. // list: [ 6, 12, 12, 33, 68 ]
To copy to clipboard, switch view to plain text mode 
...