The compiler allows this because in C ++, false matches 0 and NULL .
Personally, at least for assignments, itβs easier for me to understand and more correctly use NULL to indicate a null pointer.
Btw, before C ++, on some NULL systems was actually a macro defined as (void*)0xffff ; some information about this can be found in this answer .
source share