cpp/algorithm/bsearch

Finds an element equal to element pointed to by in an array pointed to by. The array contains elements of  bytes each and must be partitioned with respect to the object pointed to by, that is, all the elements that compare less than must appear before all the elements that compare equal to, and those must appear before all the elements that compare greater than the key object. A fully sorted array satisfies these requirements. The elements are compared using function pointed to by.

The behavior is undefined if the array is not already partitioned in ascending order with respect to key, according to the same criterion that uses.

If the array contains several elements that would indicate as equal to the element searched for, then it is unspecified which element the function will return as the result.

Return value
Pointer to the found element or null pointer if the element has not been found.