https://www.mql5.com/en/docs/basis/types/dynamic_array
See Static Arrays
Correct code:
void OnStart() { //--- double a[100]; }
It is expecting a constant value 100 instead of a variable n.

Documentation on MQL5: Language Basics / Data Types / Dynamic Array Object
- www.mql5.com
Maximum 4-dimension array can be declared. When declaring a dynamic array (an array of unspecified value in the first pair of square brackets), the compiler automatically creates a variable of the above structure (a dynamic array object) and provides a code for the correct initialization. Static Arrays When all significant array dimensions are...
Zee Zhou Ma:
https://www.mql5.com/en/docs/basis/types/dynamic_array
See Static Arrays
Correct code:
It is expecting a constant value 100 instead of a variable n.
Thanks!

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi, can anybody say why thee is an "invalid index value" error?