Sorting integers in C++
The arguments to sort are pointers to the first and one past the last elements of the array
sort(x, x+N);
This sort function will be part of the standard C++ library; you can find implementations for most current compilers if you look around