I prefer the former in this case, since you are explicitly comparing the value to see if it is null (which happens to be 0).
The second reads as if fp is Boolean, but it is not.
I like to say, "Is this pointer invalid?" vs "Is this pointer false?"
Which one is more readable for you is, of course, a matter of opinion.
Cameron
source share