2 ms·
From the point of view of C, it seems that NULL is indeed always defined as 0. At least according to the C FAQ: http://c-faq.com/null/machnon0.html http://c-fa
by avian 11y ago
From the point of view of C, it seems that NULL is indeed always defined as 0. At least according to the C FAQ:
http://c-faq.com/null/machnon0.html http://c-faq.com/null/machnon0.html
It might be that the internal representation used by the compiler is different, but from C a NULL pointer will always be equal to 0. See also:
http://c-faq.com/null/ptrtest.html http://c-faq.com/null/ptrtest.html
- zAy0LfpBZLC8mAC 11y agoWell, yes, but from the view of C, pointer values are arbitrary anyway. There is no guarantee that a particular pointer's value has any particular relationship to which RAM cell of your hardware you are accessing.
- masklinn 11y agoYou're confusing a "null constant" and a null pointer. An integral 0 being converted to a pointer at runtime is not required to be a null pointer, only an integral 0 converted at compile time is.