(C) 1998 AROS - The Amiga Research OS


NAME
#include <stdlib.h>

void * bsearch (const void *)

SYNOPSIS
const void * key
const void * base
size_t count
size_t size
int (* comparefunction(const void * const void *

FUNCTION
Search in a sorted array for an entry key.

INPUTS
key
Look for this key.
base
This is the address of the first element in the array to be searched. Note that the array *must* be sorted.
count
The number of elements in the array
size
The size of one element
comparefunction
The function which is called when two elements must be compared. The function gets the addresses of two elements of the array and must return 0 is both are equal, < 0 if the first element is less than the second and > 0 otherwise.

RESULT
A pointer to the element which equals key in the array or NULL if no such element could be found.

EXAMPLE

SEE ALSO

NOTES

BUGS

INTERNALS

HISTORY
20.10.1998 hkiel
Amiga Research OS
12.12.1996 aros
New functions