Sorry, but I have a question concerning the sort function. I tried to read the references, but I did not find the answer for my question. In this piece of code
[
#include <algorithm>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
I want to order the persons objects within the vector according to the last name. I instead of persons my people vector was a container of int's, I would just do sort(people.begin(), people.end()). But, as I have persons, how do I do this?
I already tried to write something like:
sort(people.begin(), people.end(), lastname), but the compiler just told me lastname was undeclared.