// File: genmain2.C // // Second main program to test generic selection sort #include #include #include #include "genselect.h" // Function prototypes int cmp_str(char **, char **) ; int cmp_str(char **ptr1, char **ptr2) { return strcmp(*ptr1, *ptr2) ; } main() { char *A[] = { "Space", "the", "final", "frontier", "These", "are", "the", "voyages", "of", "the", "starship", "Enterprise" } ; SelectionSort(A, 12, sizeof(char *), (CMP_FUNC) cmp_str) ; for (int i = 0 ; i < 12 ; i++) { cout << "A[" << setw(2) << setfill('0') << i << "] = " << A[i] << endl ; } }