http://kor.i2p/books/The%20C%20Programming%20Language%20by%20K&R/appb.html
The function cmp must return negative if its first argument
(the search key) is less than its second (a table entry), zero if equal, and
positive if greater. Items in the array base must be in ascending order. bsearch returns a pointer to a matching item, or NULL if none
exists. void qsort(void *base, size_t n, size_t size,
int (*cmp)(const void *, const void *)) qsort sorts into ascending order an array base[0]...base[n-1] of objects of size size .