Your comparator is being sent each pair by-address. I.e. they're pointer-to-pointer-to-char.
Change the comparator to:
int sortstring( const void *str1, const void *str2 )
{
char *const *pp1 = str1;
char *const *pp2 = str2;
return strcmp(*pp1, *pp2);
}
Likewise, your sortutil
needs to know the number of items being sorted, as well as pass the correct size of each item. Change that to:
void sortutil(char* lines[], int count)
{
qsort(lines, count, sizeof(*lines), sortstring);
}
Finally, the call from main()
should look like this:
sortutil(arr, numlines);
That should do it.