qsort()

Doug Gwyn gwyn at smoke.brl.mil
Tue Apr 23 03:59:46 AEST 1991


In article <1991Apr22.002627.14535 at engin.umich.edu> garath at irie.ais.org (Belgarath) writes:
-	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));
-}

I don't know who mailed you that, but it is utterly wrong!



More information about the Comp.lang.c mailing list