Can a pointer be null and if so can it be tested for?

PaulS:

Old habit.

No problem. Usually, I prefer explicit comparisons (myPtr != NULL), except in the case of pointer (myPtr). I'm not sure why.

I'm in the habit of explicit comparisons also. Part is computer science purism (NULL is a concept, not a particular value), part is influence from other languages, part is one particular project.

if(myPtr) is not a problem when NULL is defined as zero, which is true 99.99...% of the time.

I have worked on software where NULL was not equal to zero. Granted, it's extremely rare and a little bizarre, but it did reinforce the habit of explicit comparisons.