al - Audio Library Functions gDP - DP GBI Macros gdSP - General GBI Macros gSP - SP GBI Macros gt - Turbo Microcode RDP gu - Graphics Utilities Math - Math Functions nuSys - NuSystem os - N64 Operating System sp - Sprite Library Functions uh - Host to Target IO 64DD - N64 Disk Drive
|
bsearchFormat#include <string.h> void *bsearch(const void *key, const void *base, size_t num, size_t width, int (*compare)(void *, void*)); Arguments
A pointer to the elements that were found, or NULL if nothing is found What This Function Does Using a binary search, it finds an element that matches the key argument in an array sorted in ascending order. If the array is not in ascending order, the key can't be found. The compare argument points to the comparison function that you create in the following form: int compare ((type *) elem1, (type *) elem2); The type specifier is optional. If the value returned is less than zero, elem1 is smaller than elem2. If the value returned is zero, elem1 is equal to elem2. And if the value returned is more than zero, elem1 is larger than elem2. Note This standard function comes with NuSystem.
|