I had a very curious problem with a multidimensional array which I just can't figure out. I first made an array like this:
double MyArray[][2];
So I had an array consisting of dimensions with 2 items in the second dimension, both of which I used for some calculations in my code. I then looked at the output on my screen and so far all was good. But then I decided to add two extra items, so I got this:
double MyArray[][4];
When I checked the output of this I saw that it was different. And the strange part of this is that I did not use these last 2 items for anything in my script! I had literally only changed double MyArray[][2]; to double MyArray[][4]; and somehow this resulted in a different output. Can anyone explain me how this is even possible, because I just can' get my head around this one.
Can you copy paste the output please ?
- Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.
- You probably shouldn't be using a 2D array but a 1D array of a structure.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I had a very curious problem with a multidimensional array which I just can't figure out. I first made an array like this:
double MyArray[][2];
So I had an array consisting of dimensions with 2 items in the second dimension, both of which I used for some calculations in my code. I then looked at the output on my screen and so far all was good. But then I decided to add two extra items, so I got this:
double MyArray[][4];
When I checked the output of this I saw that it was different. And the strange part of this is that I did not use these last 2 items for anything in my script! I had literally only changed double MyArray[][2]; to double MyArray[][4]; and somehow this resulted in a different output. Can anyone explain me how this is even possible, because I just can' get my head around this one.