bsearch
Performs a binary search of a sorted array
#include <stdlib.h> void *bsearch ( const void *key, const void *base, size_t num, size_t width, int (*compar) ( const void *, const void *));
Returns a pointer to the matching member of the array, or NULL if a matching object could not be found.
bsearch performs a binary search of a sorted array of elements (pointed to by the base parameter), for an item that matches the object pointed to by the key parameter.
The size of each element in the array is the number of bytes specified by the width parameter.
The comparison function pointed to by the compar parameter is called with two arguments that point to elements in the array. The comparison function will return an integer less than, equal to, or greater than zero if the first argument is less than, equal to, or greater than the second parameter.