I tried to sort an array of string using qsort. here is the content of my array:
{"a","orange","apple","mobile","car"}
this is how I use qsort:
int myCompare (const void * a, const void * b ) {
const char *pa = (const char*)a;
const char *pb = (const char*)b;
return strcmp(pa,pb);
}
int stringLen = sizeof(input)/sizeof(char *);
qsort(input, stringLen, sizeof (char*), myCompare);
However, when I print the array, nothing is changed. is there something wrong w/ this?