Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou Newsgroups: comp.lang.c Subject: Re: question about nullptr Date: Sat, 6 Jul 2024 16:45:14 +0200 Organization: A noiseless patient Spider Lines: 28 Message-ID: References: <20240706054641.175@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sat, 06 Jul 2024 16:45:15 +0200 (CEST) Injection-Info: dont-email.me; posting-host="ac28dfb64dabbb70118b181eb38e3e1d"; logging-data="4052599"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ug/gcIhzYCOgo5YwGpM3l" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:FwHJMrsca9IpkaX+Vw7L7+b5N50= In-Reply-To: Bytes: 1951 On 06.07.2024 16:42, Janis Papanagnou wrote: > On 06.07.2024 16:04, Scott Lurndal wrote: >> Janis Papanagnou 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. >> >