Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 31
    0 is not an implementation detail. The standard defines 0 to be whatever bit pattern represents a null pointer. Commented Dec 10, 2008 at 21:01
  • 5
    As if ..!! Dude, C++ is a low level language! Use 0, it's a well known idiom. Commented Mar 30, 2009 at 3:20
  • 11
    I understand that it is a part of the standard. It is an implementation detail as far as reading the code goes. The reader should think "NULL pointer" not "0 which in this case means NULL pointer, not a number I could be doing arithmetic with." Commented Mar 14, 2013 at 20:56
  • 5
    +1. Agreed with Andy. @Ferruccio, Implementation detail of programmer's idea is not the same as compiler's implementation defined Commented Feb 15, 2014 at 23:08
  • 1
    if "NULL is not defined in this scope" occurs, then just #include <stddef.h> Commented Jul 22, 2020 at 4:25