#include #include /* This program is written to demonstrate the library. This program will demonstrate seaching and sorting and random numbers Written by James M. Rogers 17 March 1999 Released to the Public Domain on this date. */ #define ELEMENTS 50000 /* this is the compare program that we call with qsort to sort the array */ static int compar(const void *a, const void *b){ return (strcmp( (char *)a, (char *)b)); } main(){ int x, i; char *string; struct sort_test_t { char s[16]; } ; struct sort_test_t sort_test[ELEMENTS]; /* initalize the pseudo-random sequence with the time */ /* if you remove the following command then the program */ /* will generate the same series of "random" numbers each */ /* time the program is ran */ srand(time()); /* inititalize the array */ for (i=0;i