qsort of struct array not working
问题 I am trying to sort a struct run array called results by a char, but when I print the array, nothing is sorted. Have a look at this: struct run { char name[20], weekday[4], month[10]; (And some more...) }; typedef struct run run; int name_compare(const void *a, const void *b) { run *run1 = *(run **)a; run *run2 = *(run **)b; return strcmp(run1->name, run2->name); } int count_number_of_different_persons(run results[]) { int i = 0; qsort(results, sizeof(results) / sizeof(run), sizeof(run), name