Deutsch   English   Français   Italiano  
<v6c942$3ui41$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: question about nullptr
Date: Sat, 6 Jul 2024 13:23:30 -0700
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <v6c942$3ui41$1@dont-email.me>
References: <v6bavg$3pu5i$1@dont-email.me> <20240706054641.175@kylheku.com>
 <v6bfi1$3qn4u$1@dont-email.me> <l9ciO.7$cr5e.2@fx05.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 06 Jul 2024 22:23:30 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="dc2c633286188c32c212ea5809bbeb3f";
	logging-data="4147329"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18vzcltRJH2reOnIi9I55uKIb1yCpwmh58="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:KsWJCmejuvrVYdhGYfa2weZi3Ak=
Content-Language: en-US
In-Reply-To: <l9ciO.7$cr5e.2@fx05.iad>
Bytes: 2310

On 7/6/2024 7:04 AM, Scott Lurndal wrote:
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>> On 06.07.2024 14:54, Kaz Kylheku wrote:
>>> On 2024-07-06, Thiago Adams <thiago.adams@gmail.com> wrote:
>>>> If you were creating C code today and could use a C23 compiler, would
>>>> you use nullptr instead of NULL?
>>>
>>> In greenfield projects under my dictatorship, I use 0, as in:
>>>
>>>     char *p = 0;
>>>
>>> I was still 20 something when I (easily) wrapped my head around the 0
>>> null pointer constant, and have not had any problems with it.
>>> Once I learned the standard-defined truth about null pointer constants,
>>> and their relationship to the NULL macro, I dropped NULL like a hot
>>> potato, and didn't look back (except when working in code bases that use
>>> NULL).
>>
>> 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.  I always
> use the NULL macro in both C and C++ code.

Where:

void* x = 0;

Should be x = 0xc0eeeeee, right?