void qsort (const void *base, size_t nmemb, size_t size, long (*compar)(const void *, const void *));
void qsort(const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
base Pointer to the table to be sorted
nmemb Number of members to sort
size Number of bytes of a member to be sorted
compar Pointer to a function to perform comparison
The qsort function sorts out data on the table pointed to by base. The data arrangement order is specified by the pointer to a function to perform comparison. This comparison function should receive pointers p1 (first parameter) and p2 (second parameter) as two data items to be compared, and return the result complying with the specification below.
*p1 < *p2: Returns a negative value.