fill multidimensional array

 
Hello, i looking for a faster way to setup my array, but my tries failed.

At first in global scope i do this: 
double prices_reset_tp[][2];
After that onINIT i do this
ArrayResize(prices_reset_tp,number_array);

numer_array is a input var and contains for example: 3


so at this moment i should have a array like this
prices_reset_tp[0][1]
prices_reset_tp[0][2]
prices_reset_tp[1][1]
prices_reset_tp[1][2]
prices_reset_tp[2][1]
prices_reset_tp[2][2]

Now i need to fill the array, for that i can do it in typical way
prices_reset_tp[0][1]=123;
prices_reset_tp[0][2]=456;
etc.

I looking for a faster way do put this in the array, i test something like this:

prices_reset_tp={{NULL,NULL},{NULL,NULL}};
or
prices_reset_tp[]={{NULL,NULL},{NULL,NULL}};

to set all sub-elements to NULL
prices_reset_tp[0][1]=NULL;
prices_reset_tp[0][2]=NULL;
prices_reset_tp[1][1]=NULL;
prices_reset_tp[1][2]=NULL;
prices_reset_tp[2][1]=NULL;
prices_reset_tp[2][2]=NULL;

What i do wrong or what will be the correct way to do this?

 
  1. ReLor2: What i do wrong or

    Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
              Messages Editor

  2. This will create a two by two (number of elements specified)
    prices_reset_tp[][2]={{NULL,NULL},{NULL,NULL}};
    Exactly the same as
    prices_reset_tp[2][2]={{NULL,NULL},{NULL,NULL}};
    If you know how big you need, specify it. Set the first value. All remaining will default to zeros.
    prices_reset_tp[4][2]={NULL};
    You can also just use
    prices_reset_tp[4][2];
    ArrayFill(prices_reset_tp ,0 , 4*2, NULL);