Sujet : Re: question about nullptr
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 06. Jul 2024, 15:45:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6bl9r$3rljn$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 06.07.2024 16:42, Janis Papanagnou wrote:
On 06.07.2024 16:04, Scott Lurndal wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>
We also used 0 as "universal" pointer value regularly without problems.
>
Whereas I spent 6 years programming on an architecture[*] where a
null pointer was represented in hardware by the value 0xc0eeeeee.
Yes, but a 0 pointer value has not the meaning of an int value 0.
(Probably badly worded.)
I meant; the internal binary representation of a 0 pointer value
has not necessarily the internal binary representation of an int
value 0. (So you could use it also in architectures like the one
you mention.)
Janis
I always
use the NULL macro in both C and C++ code.
>
[*] now obsolete.
>