I am having trouble with my program. Here is the hw problem.
Write a program that stores lists of names (the last name first) and ages in parallel arrays and sorts the names into alphabetical order keeping the ages with the correct names. The original arrays of names and ages should remain no changes. Therefore, you need to create an array of character pointers to store the addresses of the names in the name array initially. Apply the selection sort to this array of pointers so that the corresponding names are in alphabetical order. See the sample program of Fig.8.14 from pages 479 to 481 in the textbook. You should use another array of pointers to age array to make sure the age is corresponding to the correct name.
I am using the code from the book (because the professor said that it'll make things way easy for us) I am just not understanding on how I can add a list for age while keeping it aligned with the names. I also can't seem to print the original list again after the alphabetical list without the program crashing or not including it at all. Please throw me some tips!