As a term project, I'm doing a little electronic agenda program in c++. To keep it simple, the agenda is a class containing an array of pointers, and each pointers points to an object "person" (from a class that I created). The only problem is that I HAVE TO store each person in the array in alphabetical order of last name, and then of first name (for people with the same last name). Anybody knows a way I could do it?
The program would have to store each newly created person at the right place in the array, so that the array will always be in alphabeticl order.
Thanx in advance!
The program would have to store each newly created person at the right place in the array, so that the array will always be in alphabeticl order.
Thanx in advance!