For an array to be able to store data, it must have at least 1 element.
Possibly your are thinking that it needs a minimum of 2 because you are forgetting that the first element is accessed at DynamicArray[0]

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
I was wondering whether there is a minimal amount of elements a dynamic array must have in order to work. This because I’d written a code which started by making a dynamic array of 10 elements and then it started reducing that number to 1. This did not work though, but when I changed the minimum of the dynamic array to 2 elements it did work for some reason. I still don’t really know why but could it be that a dynamic array can only be reduced up to a certain minimum, in this case 2 elements?