SearchGreat
SearchGreat
Searches for an element with a value exceeding the value of the sample in the sorted array.
int SearchGreat(
short element // sample
) constParameters
- element
[in] The sample element to search in the array.
Return Value
The position of the found element - successful, -1 - element not found.
Example:
//--- example for CArrayShort::SearchGreat(short)
#include <Arrays\ArrayShort.mqh>
//---
void OnStart()
{
CArrayShort *array=new CArrayShort;
//---
if(array==NULL)
{
printf("Object create error");
return;
}
//--- add arrays elements
//--- . . .
//--- sort array
array.Sort();
//--- search element
if(array.SearchGreat(100)!=-1) printf("Element found");
else printf("Element not found");
//--- delete array
delete array;
}Last updated on