3 ms·
That's not a null pointer. Address `0` can be valid. A null pointer critically does not compare equal to any non-null pointer, including a pointer to address 0
by SAI_Peregrinus 2y ago
That's not a null pointer. Address `0` can be valid. A null pointer critically does not compare equal to any non-null pointer, including a pointer to address 0 on platforms where that's allowed.
> An integer constant expression with the value `0` , such an expression cast to type `void *` , or the predefined constant `nullptr` is called a null pointer constant ^69) . If a null pointer constant or a value of the type `nullptr_t` (which is necessarily the value `nullptr` ) is converted to a pointer type, the resulting pointer, called a null pointer, is guaranteed to compare unequal to a pointer to any object or function.
C 23 standard 6.3.2.3.3
Also this is point 6 in the article.
- megous 2y agoIt pretty clearly is a null pointer on my machine. What's null pointer on some HP mainframe from 70's is kinda irrelevant to how I boot my systems.