Download MetaTrader 5

How to reset the default value of Global variable "Array" inside the function?

To add comments, please log in or register
Musngi
299
Musngi  

How to reset the default value of Global Variable Array inside the function?

I use global array to used it in many function but I want to reset it first before using it because I used the global array in different function.

bool x[] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};

void aaa()
{
    x[] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};    // reset default value
}

 I got error.

honest_knave
Moderator
2412
honest_knave  
Take a look at ArrayFill()
Drazen Penic
2593
Drazen Penic  
Also, check ArrayInitialize() and get familiar with all other Array Functions
honest_knave
Moderator
2412
honest_knave  
Or (although it is slower) just ArrayResize() to zero then back up to the desired size.
To add comments, please log in or register