C program to sort a list of strings using array of pointers