-
// Declaration
-
int compareByBirthday(Student & s);
-
-
// Definition
-
int Person::compareByBirthday()
-
{
-
return 0;
-
}
-
Student sub-class person, it then seems odd, wrong even, that person should have functions that take student as a parameter. If the method is declared in Person then it should take a reference to a Person not a student. If you need the data declared in Student then the method should be a member of Student not Person.
Also note from quote code that your declaration and definition of compareByBirthday do not match (and similarly for all the other compare functions).
And finally, birthday and email address appear to be members of student, however I think that all people not just students have birthdays and email addresses, the only additional piece of data that a Student has is their major.
major and compareByMajor should be in Student, the rest should be in Person.
Reading the file shouldn't be too hard, however it will be easier if you create a sensible constructor on Student and Person that allows you to pass initialisation values into it.
Don't use a fixed size array, use a STL list or one of the other STL containers.