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