Download MetaTrader 5
To add comments, please log in or register
Examine the Top MetaTrader 5 signals. Choose the best one and subscribe to it!
Alexandra
230
Alexandra 2014.07.31 19:37 
struct MyStruct
{
  double a, b, c, d;
};

 MyStruct upper[]; 
ArrayResize(upper,100);

ArrayInitialize(upper,EMPTY_VALUE);
   Is there a way struct array Initialize ?
Alain Verleyen
Moderator
28605
Alain Verleyen 2014.07.31 21:23  
Freitag:
   Is there a way struct array Initialize ?

Yes by adding a constructor to your struct. When you will use ArrayResize the constructor will be called for each element of the array.

  MyStruct() : a(EMPTY_VALUE),b(EMPTY_VALUE),c(EMPTY_VALUE),d(EMPTY_VALUE) {};
Alexandra
230
Alexandra 2014.08.01 07:23  
Thanks.
/
To add comments, please log in or register