Michel, you are missing one pointer indirection. the comparison functions does not get char *, but points into the array, so char ** int correct_strcmp(void *a,void *b) { char **pa = a; char **pb = b; return strcmp (*pa,*pb); }