SearchLast
Finds the last element equal to the model in sorted array.
int SearchLast(
string element
) const |
Parameters
element
[in] The sample element to search in the array.
Return Value
Example:
//--- example for CArrayString:: SearchLast(string)
#include <Arrays\ArrayString.mqh>
//---
void OnStart()
{
CArrayString *array=new CArrayString;
//---
if(array==NULL)
{
printf("Object create error");
return;
}
//--- add arrays elements
//--- . . .
//--- sort array
array.Sort();
//--- search element
if(array.SearchLast("ABC")!=-1) printf("Element found");
else printf("Element not found");
//--- delete array
delete array;
} |