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:
QList<int> list; list << 33 << 12 << 68 << 6 << 12; qSort(list.begin(), list.end()); // list: [ 6, 12, 12, 33, 68 ]To copy to clipboard, switch view to plain text mode
Bookmarks