how to sort an array descending in c++ code example Example: how to sort in descending order in c++ sort(str.begin(), str.end(), greater<int>()); cout<<str;