How to sort a vector by descending elements using standard algorithms?
std::sort(v.rbegin(), v.rend());
I think it will be clear:
std::sort(my_vect.rbegin(), my_vect.rend()); or std::sort(my_vect.begin(), my_vect.end(), std::greater<type>);
where type is the type of vector elements (int, double, string, etc.)
Source: https://ru.stackoverflow.com/questions/98026/More articles:Textarea is not friendly with valueHow to stretch the background image over the entire size of the widget in QT?Deleting a record from a table without using GETHow to connect to MS SQL using ASP?How to serialize an instance of a class to an XML string?Counting the number of postsHigh-load web projects [closed]Installing the ObjectivEclipse pluginFTP connection hangsVisual fix for DataGridViewAll Articles