The _lfind function performs a linear search for the value key in
the array pointed to by base. The array has num elements; each
element has a size of width bytes.

The compare argument is a pointer to a user-supplied routine that
compares two array elements and returns a value specifying their
relationship. A non-zero value indicates that the elements are
different; 0 indicates that the elements are the same.

Synonym

Function: lfind

Return Value

A pointer to the first array element that matches key. If no match is
found, NULL is returned.

The _lsearch functions performs a linear search for the value key
in the array pointed to by base. The array has num elements; each
element has a size of width bytes. If the key value is not found
during the search, the lsearch function adds it to the end of the
array, and *num is incremented by 1.

The compare argument is a pointer to a user-supplied routine that
compares two array elements and returns a value specifying their
relationship. A non-zero value indicates that the elements are
different; 0 indicates that the elements are the same.

Synonym

Function: lsearch

Return Value

A pointer to the first array element that matches key. If no match is
found, the function returns a pointer to the newly added item at the
end of the array.