Code:
#include <algorithm>
...
std::sort(&array[0], &array[3]); // note, one beyond end of array
Z.