Newsgroups: comp.lang.c Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!news From: garath@irie.ais.org (Belgarath) Subject: qsort() Message-ID: <1991Apr22.002627.14535@engin.umich.edu> Sender: news@engin.umich.edu (CAEN Netnews) Organization: There is NO organization in my life. Randomness rules Date: Mon, 22 Apr 1991 00:26:27 GMT Thanks to everyone who mailed me with the solution to how to use qsort(). Basically after you have defined the structure you do: qsort((char *) info, 49, sizeof(the_srtuct), compare); int compare(ptr1, ptr2) struct the_struct *ptr1; struct the_struct *ptr2; { return (strcmp(ptr1->name, ptr2->name)); }