Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Searching and Sorting 

Use the following functions for searching and sorting.

Searching and Sorting Functions
Function Search or Sort .NET Framework equivalent

bsearch

Binary search

System::Collections::ArrayList::BinarySearch

bsearch_s

A more secure version of bsearch.

System::Collections::ArrayList::BinarySearch

_lfind

Linear search for given value

System::Collections::ArrayList::Contains

_lfind_s

A more secure version of _lfind

System::Collections::ArrayList::Contains

_lsearch

Linear search for given value, which is added to array if not found

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

_lsearch_s

A more secure version of _lsearch

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

qsort

Quick sort

System::Collections::ArrayList::Sort

qsort_s

A more secure version of qsort

System::Collections::ArrayList::Sort

Community Additions

ADD
Show:
© 2015 Microsoft