Sujet : Re: question about nullptr
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 16. Jul 2024, 02:22:55
Autres entêtes
Organisation : None to speak of
Message-ID : <87zfqiqgeo.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5
User-Agent : Gnus/5.13 (Gnus v5.13)
James Kuyper <
jameskuyper@alumni.caltech.edu> writes:
On 7/15/24 18:51, Lawrence D'Oliveiro wrote:
On Fri, 12 Jul 2024 14:19:19 +0100, Richard Harnden wrote:
Don't you use '\n'? Surely nobody would say 0x0a?
Why not full symbolic Unicode names, à la Python:
"\n" == "\N{LINE FEED}"
⇒
True
>
Keep in mind that, in text mode, the <stdio.h> library routines use '\n'
in memory to represent whatever platform-specific method is used in
files to indicate a new line. For example, that can be a simple '\n' on
typical Unix-like machines, '\n\r' or '\r\n' on other operating systems,
and on a number of older systems, it could be converted to and from a
fixed-size block with a character count at the the beginning of the
block. There's no requirement that it be the Unicode line feed character.
To be clear (and I'm sure you know this), that conversion occurs on
input and output, not when a string literal is compiled.
Even if an OS uses a single byte as an end-of-line marker in disk files,
none of '\n', ASCII LF, and the external representation have to match
(though it's certainly convenient if they all do). An implementation
could have '\n' represent ASCII LF in memory but use ASCII CR to mark
line endings in files.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */