Working from the definition of Family Tree Node given in the section entitled “Representing family trees in C++,” write a function
Family Tree Node *read Family Tree (string filename);
that reads in a family tree from a data file whose name is supplied as the argument to the call. The first line of the file should contain a name corresponding to the root of the tree. All subsequent lines in the data file should have the following form:
child: parent
where child is the name of the new individual being entered and parent is the name of that child’s parent, which must appear earlier in the data file. For example, if the file Normandy.txt contains the lines
calling read Family Tree("Normandy.txt") should return the family-tree structure shown in Figure 16-2.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here