Function name: Qsort
Function: Sort by rapid sort routine
Usage: Void Qsort (Void * Base, Int Nelem, Int Width, INT (* FCMP) ());
Example:
#include
#include
#include
INT Sort_function (const void * a, const void * b);
Char List [5] [4] = {"Cat", "Car", "CAB", "CAP", "CAN"}
Int main (void)
{
INT X;
Qsort (void *) list, 5, sizeof (list [0]), sort_function;
FOR (x = 0; x <5; x )
Printf ("% S / N", List [x]);
Return 0;
}
INT Sort_Function (const void * a, const void * b)
{
Return (Strcmp (A, B));
}