Here's a class definition. You'll have to implement its functions, create its instances, and find the eldest person.
Person(const std::string& name, int year, int month, int day);
friend bool operator<(const Person& lhs, const Person& rhs);
For a discussion of comparison operators like
, see the discussion halfway down this page
]. Bookmark that site, which is my go-to reference for C++.
A good argument can be made that your design should first define a
class for the
members, so that
would only have
would then be a member of
; it makes more sense to compare two dates than it does two people, and the
class could then also be used by other classes that required a date.