/* teststring2.cpp CIS 150 David Klick 6/30/05 Sorting C-style strings. */ #include #include using std::cout; using std::cin; const int ARRAY_SIZE = 5; void sort(char nm[][20], int len); int main(void) { char names[ARRAY_SIZE][20]; // storage for five names int i; cout << "Entering " << ARRAY_SIZE << " names\n"; // get names from user for (i=0; i 0) { strcpy(temp, nm[i]); strcpy(nm[i], nm[j]); strcpy(nm[j], temp); } } } } /* Sample output: Entering 5 names Enter name #1: Fred Enter name #2: Sue Enter name #3: Thomas Enter name #4: Alexandra Enter name #5: Penelope The names you entered were: Fred Sue Thomas Alexandra Penelope The names in sorted order are: Alexandra Fred Penelope Sue Thomas */