Parameters

comparison function which returns ​a negative integer value if the first argument is less than the second,

a positive integer value if the first argument is greater than the second and zero if the arguments are equal. key is passed as the first argument, an element from the array as the second.
The signature of the comparison function should be equivalent to the following:

int cmp(constvoid*a, constvoid*b);

The function must not modify the objects passed to it and must return consistent results when called for the same objects, regardless of their positions in the array.

​

Return value

Pointer to the found element or NULL if the element has not been found.