Sorting

I just have a question with the sort command used with vectors, does it only sort in ascending order? or is it possible for it to also sort everything in descending order?
Last edited on
see http://www.cplusplus.com/reference/algorithm/sort/
comp
Comparison function object that, taking two values of the same type than those contained in the range, returns true if the first argument goes before the second argument in the specific strict weak ordering it defines, and false otherwise.

if you define a function for it, you can sort things any way you want.
Oh I see thanks a lot :)
Topic archived. No new replies allowed.