Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
lfind(3)
Edit
PageHistory
Diff
Info
LikePages
LSEARCH !!!LSEARCH NAME SYNOPSIS DESCRIPTION RETURN VALUE SEE ALSO ---- !!NAME lfind, lsearch - linear search of an array. !!SYNOPSIS __#include __''key''__, const void *__''base''__, size_t *__''nmemb''__, size_t__ ''size''__, int (*__''compar''__)(const void *, const void *)); void *lsearch(const void *__''key''__, void *__''base''__, size_t *__''nmemb''__, size_t__ ''size''__, int (*__''compar''__)(const void *, const void *)); __ !!DESCRIPTION __lfind()__ and __lsearch()__ perform a linear search for ''key'' in the array ''base'' which has *''nmemb'' elements of ''size'' bytes each. The comparison function referenced by ''compar'' is expected to have two arguments which point to the ''key'' object and to an array member, in that order, and which returns zero if the ''key'' object matches the array member, and non-zero otherwise. If __lsearch()__ does not find a matching element, then the ''key'' object is inserted at the end of the table, and *''nmemb'' is incremented. !!RETURN VALUE __lfind()__ returns a pointer to a matching member of the array, or __NULL__ if no match is found. __lsearch()__ returns a pointer to a matching member of the array, or to the newly added member if no match is found. !!SEE ALSO bsearch(3), hsearch(3), tsearch(3) ----
One page links to
lfind(3)
:
Man3l
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.