搜索和排序Searching and Sorting

可使用下列函数进行搜索和排序。Use the following functions for searching and sorting.

搜索和排序函数Searching and Sorting Functions

函数Function 搜索或排序Search or Sort
bsearchbsearch 二进制搜索Binary search
bsearch_sbsearch_s bsearch 的更安全版本A more secure version of bsearch
_lfind_lfind 线性搜索给定值Linear search for given value
_lfind_s_lfind_s _lfind 的更安全版本A more secure version of _lfind
_lsearch_lsearch 线性搜索给定值,如果找不到,则已添加至数组Linear search for given value, which is added to array if not found
_lsearch_s_lsearch_s _lsearch 的更安全版本A more secure version of _lsearch
qsortqsort 快速排序Quick sort
qsort_sqsort_s qsort 的更安全版本A more secure version of qsort

另请参阅See Also

按类别分的运行时例程Run-Time Routines by Category