int array[]; array[0]=1;The array has no size, therefor there is no array[0].
The array has no size, therefor there is no array[0].
@whroeder1's is correct.
Based upon your prior post, perhaps you are confusing how indicators handle buffers (arrays to hold indicator values) and general arrays that you create for your own purposes.
Indicators handle the sizing of arrays (buffers) automatically.
In Scripts or EA's, you must set the dimension of the array yourself.
This can be a fixed amount
int array[4];
or you can use ArrayResize() to set the amount dynamically.
Hello,
Why does this script produce a out of range ?
Thanks,
Pierre