[#OBJ_bsearch_]
= OBJ&lowbar;bsearch&lowbar;
:mrdocs:

Binary&hyphen;search a sorted array of fixed&hyphen;size elements using a comparator&period;

== Synopsis

Declared in `&lt;openssl&sol;objects&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void const*
OBJ&lowbar;bsearch&lowbar;(
    void const* key,
    void const* base,
    int num,
    int size,
    int(* cmp)(void const*, void const*));
----

== Description

Used internally by the OBJ&lowbar;bsearch&lowbar;&ast; helpers&semi; prefer those type&hyphen;safe wrappers&period;

== Return Value

Pointer to the matching element, or NULL if not found&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| Pointer to the search key passed as the first argument to `cmp&period;`
| *base*
| Base address of the sorted array&period;
| *num*
| Number of elements in the array&period;
| *size*
| Size of each element in bytes&period;
| *cmp*
| Comparison callback returning negative, zero, or positive like strcmp&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
