46 lines
802 B
Markdown
46 lines
802 B
Markdown
# CompareArray
|
||||
|
|
|
|||
|
|
Compares the array with another one.
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
bool CompareArray(
|
|||
|
|
const string& src[] // source array
|
|||
|
|
) const
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Parameters
|
|||
|
|
|
|||
|
|
src[]
|
|||
|
|
|
|||
|
|
[in] Reference to an array used as a source of elements for comparison.
|
|||
|
|
|
|||
|
|
Return Value
|
|||
|
|
|
|||
|
|
true - arrays are equal, false - arrays are not equal.
|
|||
|
|
|
|||
|
|
Example:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
//--- example for CArrayString::CompareArray(const string &[])
|
|||
|
|
#include <Arrays\ArrayString.mqh>
|
|||
|
|
//---
|
|||
|
|
string src[];
|
|||
|
|
//---
|
|||
|
|
void OnStart()
|
|||
|
|
{
|
|||
|
|
CArrayString *array=new CArrayString;
|
|||
|
|
//---
|
|||
|
|
if(array==NULL)
|
|||
|
|
{
|
|||
|
|
printf("Object create error");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
//--- compare with another array
|
|||
|
|
int result=array.CompareArray(src);
|
|||
|
|
//--- delete array
|
|||
|
|
delete array;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
```
|