Initialize struct array

 
struct MyStruct
{
  double a, b, c, d;
};

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

ArrayInitialize(upper,EMPTY_VALUE);
   Is there a way struct array Initialize ?
 
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) {};
 
Thanks.
Reason: