感謝,在C11 standard是這樣定義:6.3.2.3-3: An integer constant expression with thevalue 0, or such an expression cast to type void *,is called a null pointer constant.If a null pointer constant is converted to a pointertype, the resulting pointer, called a null pointer,is guaranteed to compare unequal to a pointer to anyobject or function.所以我們不能說NULL是0,這是有問題的。至於要怎麼說怎麼解釋給新手聽,還要再想想 Orz
N4582 http://imgur.com/ZseDxIWThe macro NULL is an implementation-defined C++ nullpointer constant in this International StandardN4582, 18.2, 3但我覺得C++11都出了,為何不用nullptr?直接警告新手,使用nullptr而不是0或NULL