Accessing time in a class function, Problem

 

Please, I am trying to access the "time" constant in a class. The idea was or is to create a function in the class that accepts the const, then pass it to a class variable "m_time", which I would be able to use in the class for member functions that would require the time Array to run.

class Run
  {
private:
   datetime m_time[];      // Time Array I intend to use in the class for all function that require time array
public:
   //---
      void           Init(const datetime &time[]);
                     Run(void){};
                    ~Run(void){};
  }Temp;
void    Run::Init(const datetime &time[])
   {
      m_time = time;
   }

Am getting different type of Error messages ranging from invalid array access to "&" improper use etc ... I have tried different things, but the solution is proving evasive, any help would be appreciated.

Thanks

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
Predefined Macro Substitutions - Named Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

The target array has to be resized and elements copied individually.

void    Run::Init(const datetime &time[])
   {
      ArrayCopy(m_time,time);
   }
 
Ernst Van Der Merwe:

The target array has to be resized and elements copied individually.

Thanks