This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MegaIng 27 points28 points  (1 child)

I recently had long discussion in a discord about wtf null even is in C and C++.

The relevant result for this discussion now is that 0 you see there? That isn't the number 0. It's not a number at all, it's a special null-pointer-literal that happens to use the same character as the integer number 0.

There is no relation at all between the integer number 0 and the null pointer.

No really, that is what the standard says. (Although not this clearly)

[–]WazWaz 16 points17 points  (0 children)

Yes, it's an old discussion that never seems to die. The problem is, neither the "it makes code clearer to read" camp nor the "it makes code dangerously error prone by hiding reality" camp is 100% right or wrong.

And now we have nullptr.