// File: genmain2.cpp // // Second main program to test generic selection sort #include #include "genselect.h" using namespace std ; // 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[" << i << "] = " << A[i] << endl ; } }