Download MetaTrader 5

Assign array to local variable

To add comments, please log in or register
Alex
77
Alex  

Hi,

Is it possible to assign an array to a local variable? I've tried the following but I get a "pointer cannot be used" error.

 

class Foo {

private:

   const double *high; 

public: 

   void Foo(const double &a_high) {

       high = a_high;

   }; 

} ;

Ex Ovo Omnia
3317
Ex Ovo Omnia  
Alex:

Hi,

Is it possible to assign an array to a local variable? I've tried the following but I get a "pointer cannot be used" error.

 

class Foo {

private:

   const double *high; 

public: 

   void Foo(const double &a_high) {

       high = a_high;

   }; 

} ;

No, the only way I know of is wrapping the array into a class and passing an object in place of the array.
Alex
77
Alex  
Ovo Cz:
No, the only way I know of is wrapping the array into a class and passing an object in place of the array.

Ok, Thanks Ovo Cz.

 

Annoying but I guess they have their reasons. 

To add comments, please log in or register