QSorting a malloc'd array of structures?
问题 I have this comparator function for my qsort in C, but I seem to be getting a segmentation fault no matter what I try... int textCompare ( const void * a, const void * b ){ const char **x =(const char**)a; const char **y =(const char**)b; return strcmp(*x, *y); } Here is my qsort call: where message** mList = malloc(INITIAL_CAPACITY * sizeof(message)); and count is an integer keeping track of the last element. message is just a typedef struct that contains an int and a pointer to a char. I'm