I\'m not sure if this is possible to do with qsort because what I want to sort (array of pointers to struct) is not what I am comparing (strings).
Here is an abridge
What will be passed to cmp() are struct student** parameters (in the guise of void*). So change cmp() like so:
cmp()
struct student**
void*
int cmp(const void *p0, const void *p1) { struct student* ps0 = *(struct student**) p0; struct student* ps1 = *(struct student**) p1; return strcmp( ps0->lname, ps1->lname); }