Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/1695-standardlibrary-datastructures-carraydouble-carraydoubleassignarrayconst.md
T
2026-06-23 21:47:51 +08:00

65 lines
1.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AssignArray
Copies the elements of one array to another.
```
bool  AssignArray(
   const CArrayDouble*  src      // pointer to the source
   )
```
Parameters
src
[in] Pointer to an instance of the CArrayDouble class used as a source of elements to copy.
Return Value
true - successful, false - cannot copy the elements.
Example:
```
//--- example for CArrayDouble::AssignArray(const CArrayDouble*)
#include <Arrays\ArrayDouble.mqh>
//---
void OnStart()
  {
   CArrayDouble *array=new CArrayDouble;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- create source array
   CArrayDouble *src  =new CArrayDouble;
   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;
  }
```