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
Ok, thank you! According to documentation !ptr will also do a check to CheckPointer(ptr) == POINTER_INVALID.
To sum up:
Is this
the same as this:
if(!pointerObj){..}The answer is yes. So the MQL5 compiler handles NULL in a special way, e.g.: !NULL (regardless of whether it is a pointer or object) returns true.
!NULL => true
NULL is void
NULL is void
Ok, thank you! According to documentation !ptr will also do a check to CheckPointer(ptr) == POINTER_INVALID.
To sum up:
Is this
the same as this:
The answer is yes. So the MQL5 compiler handles NULL in a special way, e.g.: !NULL (regardless of whether it is a pointer or object) returns true.
NULL is void
This makes more sense. So at the end:
This
is the same as
I don't know if the compiler treats void in CheckPointer in any special way. I don't think so.
This makes more sense. So at the end:
This
is the same as
I don't know if the compiler treats void in CheckPointer in any special way. I don't think so.
What patterns make you need to check pointers? I don't check pointers because I know whether a particular pointer is valid at the coding stage.
This makes more sense. So at the end:
This
is the same as
I don't know if the compiler treats void in CheckPointer in any special way. I don't think so.
I don't check pointers because I know whether a particular pointer is valid at the coding stage.
Here's an example (the first one I came across; it's MQL4, sorry) where I avoid checking the pointer using an out bool variable