Hi, I read that using ArrayCopy on the same array could cause data corruption when the initial source index is lower than the target index, due to the left-to-right copy.
I tried, but no data corruption was detected. Can I be sure this won't happen under any circumstances?
Here a simple script:
Thanks for help.
Here in the documentation, we are warned that "It is permitted to copy elements from an array to itself. But if the target and source areas overlap, you need to keep in mind that the iteration is done from left to right".
In this forum post same conclusion, and also gemini google answer statament same thing.
- www.mql5.com
Here in the documentation, we are warned that "It is permitted to copy elements from an array to itself. But if the target and source areas overlap, you need to keep in mind that the iteration is done from left to right".
It's not stated in this link to the book that there could be a data corruption. Just that the iteration is done from left to right.
In this forum post same conclusion, and also gemini google answer statament same thing.
This forum post gives wrong information (possibly something changed since 2023).
In summary, there is no data corruption using ArrayCopy in MQL5.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I read that using ArrayCopy on the same array could cause data corruption when the initial source index is lower than the target index, due to the left-to-right copy.
I tried, but no data corruption was detected. Can I be sure this won't happen under any circumstances?
Here a simple script:
Thanks for help.