Sujet : Re: question about nullptr
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 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/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca