Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Unfortunately, unless you post up your code I can't help you.
As you can see from my example above (and the examples in the documentation) it works.
Good luck!
this is my code :
#property strict
extern int Count=4; // Global variable
int OnInit()
{
#define l (Count)
double wInput[l];
for(int cnt=0;cnt<ArrayRange(wInput,0);cnt++){
wInput[cnt]=MathRand();
Alert(wInput[cnt]);
}
return 0;
}
i want to get a number from user then use it to define an array than randomly initialize it.
i want to use multi dimention and using resize is not an option because i cannot define dynamic array more than one dimention.You can't use a variable (Count) to define the constant (l)
i want to use multi dimention and using resize is not an option because i cannot define dynamic array more than one dimention.Yes, you can have a dynamic multi-dimensional array, but only the first dimension can be dynamic e.g.
You can't use a variable (Count) to define the constant (l)
Yes, you can have a dynamic multi-dimensional array, but only the first dimension can be dynamic e.g.
that is the problem i should input two dimensions and then define it!
it is very bad that mql has such restriction !!!!
There are always ways around things.
You can create an array of structures. The structure contains an array.
You can resize the array of structures, and you can resize the array inside the structure.
e.g.
There are always ways around things.
You can create an array of structures. The structure contains an array.
You can resize the array of structures, and you can resize the array inside the structure.
e.g.