i have a vector that stores students as objects each student object has data containing grades that are input by the user, the user enters 4 grades and gets a total grade. i want to be able to sort this data in a list going from highest to lowest but i am having trouble figuring it out, this is what i have for the function so far however it does not run it returns the error that cout doesnt match operands. im sure there is a far better way to this, any help would be greatly appreciated!
static void compare(vector<Student>& students) {
vector<Student> students{};
sort(students.begin(), students.end());
cout << "Sorted \n";
for (auto x : students) {
cout << x << " ";
}
}