void * bsearch( const void * key, const void * base, size_t nmemb, size_t size, int (*compar)( const void *, const void * ) )
Performs a binary search inside an array of nmemb itens of size bytes
key | a pointer to the data to compare to |
base | the offset of the array |
nmemb | the amount of objects in the array |
size | the size of each object in the array |
compar | a pointer to a function that compares the key and an element in the array |
Returns a pointer to the found element
Returns NULL if there is no element found
Performs a binary search inside an array of nmemb itens of size bytes
void * bsearch( const void * key, const void * base, size_t nmemb, size_t size, int (*compar)( const void *, const void * ) )