Errors, bugs, questions - page 3141
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
Oleg Pavlenko #:
Why does it work correctly in MQL4 without zeroing, but not in MQL5?
MQL4 zeroes everything by itself.
Thank you!
It helped.
I do not understand one thing, why it works correctly in MQL4 without zeroing, but not in MQL5?
MQL4 will reset everything to zero by itself.
Is there a difference between ZeroMemory(array); and ArrayFree(array); for the array to be zeroed? If after this function a new array size is assigned, ArrayResize(array,100,100);
Is there a difference between ZeroMemory(array); and ArrayFree(array); for an array to be zeroed? If after this function a new array size is assigned, ArrayResize(array,100,100);
ZeroMemory doesn't free memory, it only zeroes it.
ZeroMemory does not free the memory, it only resets it to zero.
thanks
Is there a difference between ZeroMemory(array); and ArrayFree(array); for an array to be zeroed? If after this function a new array size is assigned, ArrayResize(array,100,100);
I think there are some subtleties here. If the array's size is increased after ZeroMemory(array);, we may get "trash" in the array cells that are "behind". If you apply ArrayFree (array);, the "rubbish" may be located anywhere in the array.
So, it is possible to choose only by making some experiments in speed of these functions. And it is the programmer who decides about the "trash". If an array is filled with values right after declaration or resizing, what's the point of zeroing and then filling this array...
As far as I understand, all L0X in enum LIST {} are independent. However, as soon as we assign the same value (666) to some enum elements, the default comment stops displaying correctly, picking up comment (and apparently value, although it's hard to say, as they are the same and impossible to understand) from the first element with the same value (see last three linesin enum LIST {}) for some reason.
Worse, when trying to change the default display of line 7 from "ITEM 6" to "ITEM 7" and line 8 to "ITEM 8" in Program Settings, whichare originally in the code comments, they are persistently knocked back to"ITEM 6":
There's a typo here