I was interviewing a guy for a mid-level software engineering position yesterday, and he mentioned that in C, NULL is not always zero and that he had seen implementations of C where NULL is not zero. I find this highly suspect, but I want to be sure. Anyone know if he is right?
(Responses will not affect my judgement on this candidate, I've already submitted my decision to my manager.)
I'm assuming you mean the null pointer. It is guaranteed to compare equal to 0
.1 But it doesn't have to be represented with all-zero bits.2
See also the comp.lang.c FAQ on null pointers.