Help with Sorting

This is a discussion on Help with Sorting within the C++ Programming forums, part of the General Programming Boards category; I am having trouble on my sort. I am trying to sort First and Last Name (in ABC order), and ...

Help with Sorting

I am having trouble on my sort. I am trying to sort First and Last Name (in ABC order), and for every name there is the age, city, state, etc.. Obviously when I sort the Names, I have to get the age, city, state, etc.. to go along with it. I have managed to get age and zipcode to switch along with the names, but I dont know how to change the city to go along with the name because it is a char. How would I do this?

I know my code is really rough, and there are better ways to do the whole code, but what is the most simplest way possible to get the city to change along with the First and Last name? Thanks!