Re: question about nullptr

Liste des GroupesRevenir à cl c  
Sujet : Re: question about nullptr
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.c
Date : 13. Jul 2024, 00:28:49
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240712161502.715@kylheku.com>
References : 1 2 3 4 5
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-07-12, Scott Lurndal <scott@slp53.sl.home> wrote:
Kaz Kylheku <643-408-1753@kylheku.com> writes:
On 2024-07-12, Richard Harnden <richard.nospam@gmail.invalid> wrote:
>
>
Don't you use '\n'? Surely nobody would say 0x0a?
>
But, see, nobody in their right mind would say '\012` for that. '\0'
an octal escape sequence like '\012', not a role-based character
abstraction like '\n'.
>
Actually, it's entirely likely that a programmer using C in 1978
would have used \012 for newline - it was the custom to use octal
on the PDP-11.   Consider the od(1) utility, for example.

But why would they use '\012', if 012 was available. The quotes
and backslash doubles the character count and create visual clutter.

If I want the number 10 of type int, why would I switch into
a character quote inside of which I have to escape back to
a numeric specification.

In C++ it makes sense, because we get the char type, which can
be important:  foo('\012') -> pick the foo(char) overload, not
the foo(int).

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Date Sujet#  Auteur
6 Jul 24 * question about nullptr125Thiago Adams
6 Jul 24 +- Re: question about nullptr1Bonita Montero
6 Jul 24 +- Re: question about nullptr1John McCue
6 Jul 24 +- Re: question about nullptr104Kaz Kylheku
6 Jul 24 `* Re: question about nullptr18Richard Damon
6 Jul 24  `* Re: question about nullptr17David Brown
7 Jul 24   +* Re: question about nullptr2Lawrence D'Oliveiro
7 Jul 24   i`- Re: question about nullptr1David Brown
21 Jul 25   `- 

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal