bsearch man page on OPENSTEP

Man page or keyword search:  
man Server   1419 pages
apropos Keyword Search (all sections)
Output format
OPENSTEP logo
[printable version]


BSEARCH(3)							    BSEARCH(3)

NAME
       bsearch - perform a binary search

SYNOPSIS
       #include <stdlib.h>

       void bsearch(const void *key,
		 const void *base,
		   size_t nmemb,
		 size_t size,
		 int (*compar)(const void *, const void *));

DESCRIPTION
       The  bsearch  function  searches an array of nmemb objects, the initial
       member of which is pointed to by base, for an element that matches  the
       object  pointed	to  by	key.  The size of each element of the array is
       specified by size.

       The comparison function	pointed	 to  by	 compar	 is  called  with  two
       arguments that point to the key object and to an array element, in that
       order.  Bsearch returns an integer less than, equal to, or greater than
       zero if the key object is considered, respectively, to be less than, to
       match, or to be greater	than  the  array  element.   The  array	 shall
       consist	of:  all  the elements that compare less than, all the objects
       that compare equal to and all the objects that compare greater than the
       key object, in that order.

RETURN VALUE
       Bsearch returns a pointer to a matching element of the array, or a null
       pointer if no match is found.  If two elements compare as equal, it  is
       indeterminate which element will be matched.

SEE ALSO
       qsort(3)

STANDARDS
       The bsearch function conforms to ANSI-C.

7th Edition			August 1, 1992			    BSEARCH(3)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server OPENSTEP

List of man pages available for OPENSTEP

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net