void *bsearch (const void *key, const void *base, size_t nel, size_t size, int (*compar)(const void *, const void *));
The table must be previously sorted in increasing order according to a comparison function pointed to by compar. This routine is called with two arguments, the pointers to the elements being compared. It returns an integer less than, equal to, or greater than 0, according to whether the first argument is to be considered less than, equal to, or greater than the second argument. The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared.
Specifies the data you are searching for in the table.
Points to the element at the base of the table.
Is the number of elements in the table.
Is the number of bytes in each element.
Specifies the comparator function.
If the key cannot be found in the table,
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.3 Documentation Build 39.