Hi guys, i need help in sorting vectors according to criteria.
This was a boolean comparator function that i wrote to sort array values in descending order. However, my assignment needs me to sort them in a more specific criteria like according to area, x and y coordinates , length etc.
However, the boolean function i wrote only takes in the first address of the array and compares it. How do i do it in a way that it compares the values that i desire.
The values that i wish to sort are stored in vectors in the following format
[9,9] 12.278
if i want to sort it by 12.278 which is the distance. How do i modify my boolean function to sort according to the distance which is the 3rd value instead of the first?