Download MetaTrader 5

Available

Gets the number of free elements of the array that are available without additional memory allocation.

int  Available() const

Return Value

Number of free elements of the array available without additional memory allocation.

Example:

//--- example for CArray::Available()
#include <Arrays\Array.mqh>
//---
void OnStart()
  {
   CArray *array=new CArray;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- check available
   int available=array.Available();
   //--- use array
   //--- ...
   //--- delete array
   delete array;
  }


Updated: 2016.03.08