AssignArray
Copies the elements of one array to another.
bool AssignArray(
const CArrayShort* src
)
|
Parameters
src
[in] Pointer to an instance of the CArrayShort class used as a source of elements to copy.
Return Value
Example:
//--- example for CArrayShort::AssignArray(const CArrayShort*)
#include <Arrays\ArrayShort.mqh>
//---
void OnStart()
{
CArrayShort *array=new CArrayShort;
//---
if(array==NULL)
{
printf("Object create error");
return;
}
//--- create source array
CArrayShort *src =new CArrayShort;
if(src==NULL)
{
printf("Object create error");
delete array;
return;
}
//--- add source arrays elements
//--- . . .
//--- assign another array
if(!array.AssignArray(src))
{
printf("Array assigned error");
delete src;
delete array;
return;
}
//--- arrays is identical
//--- delete source array
delete src;
//--- use array
//--- . . .
//--- delete array
delete array;
}
|