|
|
std::sort(numbers, numbers+sizeof(numbers)/sizeof(int);
std::sort(std::begin(numbers), std::end(numbers); //C++11
numbers
.std::sort(numbers+1, numbers+4);
template <class RandomAccessIterator> void sort (RandomAccessIterator first, RandomAccessIterator last); |
template
allows you to call the function with any data type. See this for more info:class RandomAccessIterator
int arr[] = { 1, 2, 3, 4 };