Question: how to qsort a struct?
Answer: In qsort function call. qsort(arr, n, sizeof(struct Student ),comparator); Inside comparator: int comparator(const void* p0, const void* p1) { struct Student* ps0 = (struct Student*) p0; struct Student* ps1 = (struct Student*) p1; return strcmp( ps0->name, ps1->name); }