qsort() - HELP

Dave Davey daved at physiol.su.oz
Thu Feb 15 13:08:36 AEST 1990


jha at spodv5.UUCP (Johan Harsta) writes:

|In article <5916 at ozdaltx.UUCP>, root at ozdaltx.UUCP (root) writes:
|> After going over the manuals more times than I'd like, I still can't
|> figure out how to get qsort() (S) to operate.  The example shows

|E.g.:
|	struct ELEMENT buffer[nele];

|	sort_buf (&buffer[0], nele);

|	void
|	sort_buffer (base, nele)
|		struct ELEMENT *base;
|		int nele;
|	{	

					/*****************************/
		int sorting_alg();	/**** needs this declaration */
					/*****************************/

|		qsort ((char *) base, 
|			(unsigned) nele, 
|			(unsigned) sizeof (struct ELEMENT),
|			sorting_alg);
|		return;
|	}



More information about the Comp.lang.c mailing list