Add
Add
Adds an element to the end of the array.
bool Add(
double element // element to add
)Parameters
- element
[in] Value of the element to add to the array.
Return Value
true - successful, false - cannot add an element.
Example:
//--- example for CArrayDouble::Add(double)
#include <Arrays\ArrayDouble.mqh>
//---
void OnStart()
{
CArrayDouble *array=new CArrayDouble;
//---
if(array==NULL)
{
printf("Object create error");
return;
}
//--- add arrays elements
for(int i=0;i<100;i++)
{
if(!array.Add(i))
{
printf("Element addition error");
delete array;
return;
}
}
//--- use array
//--- . . .
//--- delete array
delete array;
}Last updated on