Given an array of strings (i.e char *strings[10]), write C code to sort the list in increasing order of string length. Run time efficiency is a primary concern.

Why is run time efficiency a primary concern when sorting
an array of just ten elements? With such a short array, how
do you even hope to measure the run time to find out what kind
of efficiency you've achieved?

You obviously didn't test this, because that won't work at all. The
const void * arguments qsort passes to the compare function are pointers
to the array elements - not the array elements themselves. In this
case, they're pointer-to-pointer-to-char, converted to void *. In this
case, the correct comparison function would be:

You obviously didn't test this, because that won't work at all. The const void * arguments qsort passes to the compare function are pointers to the array elements - not the array elements themselves. In this case, they're pointer-to-pointer-to-char, converted to void *. In this case, the correct comparison function would be:

Then your compiler is broken :). const void *a; and char * const *sa;
are equivalently-qualified pointers, but char const **sa; is not. The
first points to a const-qualified void, the second to a const-qualified
pointer to char, but the third points to a non-qualified pointer to a
pointer to const-qualified char.