I need help with creating a search function that will search for the head name then display the name (birthdate-deathdate) spouse (their birthdate) [if M]
followed on the next line and tabbed the children's name if any present.
thanks in advance for any help!!!!!
Firstly, you either need to make all the data members in class Person public or write functions to return their values (eg string person::getName () {return name;}) - as they are private members, you currently have no way of legally accessing them.
Secondly, how are you storing this data (eg in an stl container)? The way you store it alters how you can search for the person.
Thirdly, I'd suggest that your person class actually held pointers to all of its children - not just one of them with indirect connections to all the others.