home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!aplcen.apl.jhu.edu!bandy
- From: bandy@aplcen.apl.jhu.edu (Mike Bandy)
- Newsgroups: comp.lang.c
- Subject: Re: qsort problem....
- Message-ID: <1992Aug12.220456.25928@aplcen.apl.jhu.edu>
- Date: 12 Aug 92 22:04:56 GMT
- References: <1992Aug10.184635.11618@tin.monsanto.com>
- Organization: Johns Hopkins University
- Lines: 37
-
- bcschu@skws02.monsanto.com (Brett Schultz) writes:
-
- >Hello, for some reason I am having a problem with a qsort system call.
- >
- >Here is a test program similar to what I am trying to do:
- >
- >#include <stdio.h>
- >#include <stdlib.h>
- >typedef struct my_float {
- > float f;
- >}my_float;
- >
- >
- >
- >main()
- >{
- int qs_compare(); /*** ADD THIS LINE ***/
- > my_float mf[5];
- > int i;
- > ... (deleted) ...
-
- > /*qsort((void *) mf, 5, sizeof(my_float), qs_compare);*/
-
- > ... (deleted) ...
- >}
- >
- >int qs_compare(my_float *a,my_float *b)
- >{
- > ... (deleted) ...
-
-
- My background is with Lattice/SAS C for the Amiga and VAX/VMS C.
- I've used this routine numerous times and your approach seems right but
- for the missing definition.
-
- Mike Bandy
- Johns Hopkins University - Applied Physics Lab
-