Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/1658-standardlibrary-datastructures-carrayfloat-carrayfloataddarrayconst.md
T
2026-06-23 21:47:51 +08:00

64 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.
# AddArray
Adds elements of one array to the end of another.
```
bool  AddArray(
   const CArrayFloat*  src      // pointer to the source
   )
```
Parameters
src
[in]  Pointer to an instance of CArrayFloat class used as a source of elements to add.
Return Value
true - successful, false - cannot add items.
Example:
```
//--- example for CArrayFloat::AddArray(const CArrayFloat*)
#include <Arrays\ArrayFloat.mqh>
//---
void OnStart()
  {
   CArrayFloat *array=new CArrayFloat;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- create source array
   CArrayFloat *src=new CArrayFloat;
   if(src==NULL)
     {
      printf("Object create error");
      delete array;
      return;
     }
   //--- add source arrays elements
   //--- . . .
   //--- add another array
   if(!array.AddArray(src))
     {
      printf("Array addition error");
      delete src;
      delete array;
      return;
     }
   //--- delete source array
   delete src;
   //--- use array
   //--- . . .
   //--- delete array
   delete array;
  }
```