Deutsch English Français Italiano |
<v6bfi1$3qn4u$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.lang.c Subject: Re: question about nullptr Date: Sat, 6 Jul 2024 15:07:11 +0200 Organization: A noiseless patient Spider Lines: 23 Message-ID: <v6bfi1$3qn4u$1@dont-email.me> References: <v6bavg$3pu5i$1@dont-email.me> <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 15:07:13 +0200 (CEST) Injection-Info: dont-email.me; posting-host="ac28dfb64dabbb70118b181eb38e3e1d"; logging-data="4021406"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kNjVDyHnk6Qxbsp1afRRV" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:K2+1ng2yx3gTJCo/LfCWg4ebsFg= X-Enigmail-Draft-Status: N1110 In-Reply-To: <20240706054641.175@kylheku.com> Bytes: 1978 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. One practical advantage of adding a named entity (with a value of 0) was to easily grep (find) appearances of this value in source code. Janis