"Felix Nawothnig" flexo@holycrap.org wrote:
Dmitry Timoshkov wrote:
However, note that NULL is not always all binary zero in memory. :)
I don't believe it's true since NULL is defined as (void *)0.
Actually it may aswell be just 0 in C. Just in C++ it's defined to be (void *)0. But even with just 0 an assignment/compare/whatever will get you an implicit typecast which makes the compiler generate any necessary conversion.
Have you read it at all? NULL is guaranteed to be 0 in all contexts.
If some C++ compiler decides to generate not 0 data while converting/casting a NULL pointer, it should be declared broken.