Sorts a table of data in place.
#include <stdlib.h>
void qsort (Base, NumberOfElements, Size, ComparisonPointer)
void * Base;
size_t NumberOfElements, Size;
int (*ComparisonPointer)(const void*, const void*);
The qsort subroutine sorts a table of data in place. It uses the quicker-sort algorithm.
The comparison function compares its parameters and returns a value as follows:
Because the comparison function need not compare every byte, the elements can contain arbitrary data in addition to the values being compared.
Note: If two items are the same when compared, their order in the output of this subroutine is unpredictable.
The pointer to the base of the table should be of type pointer-to-element, and cast to type pointer-to-character.
This subroutine is part of Base Operating System (BOS) Runtime.
The bsearch subroutine, lsearch subroutine.
Searching and Sorting Example Program, Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.