#include <stdlib.h>
void qsort(void *base, size_t num, size_t width,
int(*compare)(const void *element1, const void *element2));
The qsort() function sorts an array of num elements, each of width bytes in size, where the first element of the array is pointed to by base.
The sorted array elements are stored in increasing order, as returned by the comparison function. You can sort in reverse order by reversing the "greater than" and "less than" logic in the comparison function. If two elements are equal, their order in the sorted array is unspecified. The qsort() function overwrites the contents of the array with the sorted elements.
The qsort() function returns no values.