Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!ox.com!math.fu-berlin.de!fauern!unido!rwthinf!cip-s08!wolfram From: wolfram@cip-s08.informatik.rwth-aachen.de (Wolfram Roesler) Newsgroups: comp.lang.c Subject: Re: qsort() Message-ID: Date: 24 Apr 91 12:33:29 GMT References: <1991Apr22.002627.14535@engin.umich.edu> Sender: news@rwthinf.UUCP Lines: 16 garath@irie.ais.org (Belgarath) writes: >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)); >} The problem is that this will probably work on some - many - machines. It will certainly work on PC, ST and some Unix systems. Well, the problem in fact is that it will not work on some other systems. Use it only if you are absolutely sure you will never port the program to a different system or compiler (you are NEVER sure you will never do this, however). It just isnt portable.