/*
use can use the internal quick sort, but i find it rather limiting.
Each element of the array must be the same size which limits pointer-
to-character strings.
You also have to prepare your own comparision function.
From man qsort:
void qsort (void *base, size_t nel, size_t width,
int (*compar) (const void *, const void *));
The base argument points to the element at the base of the table. The nel
argument is the number of elements in the table. The width argument is the
size in bytes of each element. The comparison function must return an
integer less than, equal to, or greater than zero, according to whether the
first argument is to be considered as less than, equal to, or greater than the
second argument.
I ran this under SCO Open Server V.
Regards,
Ed
Schaefer
*/
#include <stdio.h>
#include <strings.h>
int comparestr(char *a, char *b);
#define NSTR 3
#define SLEN 8
void main()
{
int i;
char strings [NSTR] [SLEN];
strcpy (strings[0], "TY8845"

;
strcpy (strings[1], "GG4576"

;
strcpy (strings[2], "ER1234"

;
qsort(strings, NSTR, SLEN, comparestr);
for (i=0; i < NSTR; i++)
printf("%s\n", strings
);
exit(0);
}
/*
* compare strings a and b and return the string
* that's less
*/
int comparestr(a, b)
char *a, *b;
{
return(strcmp(a, b));
}