Hi!
I'm making a table. I originally have some names.
#include <iostream>
#include <cstring>
using namespace std;
char passengerName[100][100];
void main()
{
strcpy(passengerName[1], "Peter Tam");
strcpy(passengerName[2], "David Morris");
strcpy(passengerName[3], "Susan Leung");
strcpy(passengerName[4], "Timothy Kin");
strcpy(passengerName[5], "Mary Poon");
strcpy(passengerName[6], "Pretty Godson");
strcpy(passengerName[7], "Tammy Leung");
strcpy(passengerName[8], "Hugh Boss");
strcpy(passengerName[9], "John Cheng");
strcpy(passengerName[10], "Kathy Chan");
strcpy(passengerName[11], "Matthew Leung");
strcpy(passengerName[12], "Tim Johnson");
strcpy(passengerName[13], "Mary Puzzle");
strcpy(passengerName[14], "Ken Cheung");
strcpy(passengerName[15], "Tony Leung");
strcpy(passengerName[16], "Delia Fung");
strcpy(passengerName[17], "Celia Kwok");
strcpy(passengerName[18], "Sara Wong");
}
I want to list these names in alphabetic order.
i.e. first one should be 'Celia Kwok', then 'David Morris', etc.
How can I do that??
I just learnt the basic C++.