Standard C++ Library Reference ISO/IEC (VERSION3)
consists of nelem elements, each of size bytes, beginning with the element whose address is
base.
bsearch calls the comparison function whose address is cmp to compare the search key with
elements of the array. The comparison function must return:
a negative value if the search key ck is less than the array element ce●
zero if the two are equal●
a positive value if the search key is greater than the array element●
bsearch assumes that the array elements are in ascending order according to the same
comparison rules that are used by the comparison function.
calloc
void *calloc(size_t nelem, size_t size);
The function allocates an array object containing nelem elements each of size size, stores
zeros in all bytes of the array, and returns the address of the first element of the array if
successful; otherwise, it returns a null pointer. You can safely convert the return value to an
object pointer of any type whose size in bytes is not greater than size.
div
div_t div(int numer, int denom);
ldiv_t div(long numer, long denom); [C++ only]
The function divides numer by denom and returns both quotient and remainder in the structure
result x, if the quotient can be represented. The structure member x.quot is the algebraic
quotient truncated toward zero. The structure member x.rem is the remainder, such that
numer == x.quot*denom + x.rem.
div_t
typedef struct {
int quot, rem;
} div_t;
The type is the structure type returned by the function div. The structure contains members
that represent the quotient (quot) and remainder (rem) of a signed integer division with
operands of type int. The members shown above can occur in either order.