how to sort in descending order c++

C++
int arr[10];
int length = sizeof(arr)/sizeof(arr[0]); 
sort(arr, arr+length, greater<int>());
Source

Also in C++: