Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: null-terminated vs. nul-terminated



Am 26.03.2022 um 17:09 schrieb Warner Losh:
[*] I've not gone the extra mile and checked to see if K&R used this
phrase, to be honest.

It does.  The book from 1978 says in its tutorial section:

> getline puts the character \0 (the null character, whose value
> is zero) at the end of the array it is creating, to mark the
> end of the string of characters.

Interestingly, the section from the above quote is named "Character
Arrays", not "Strings". The definition of "string" on page 181 doesn't
mention the word "terminated", it gives the name "null byte" to the \0.

So using the word "null" to mean all kinds of nothing, including a null
pointer, a null byte and a null character, has a long tradition.

Roland


Home | Main Index | Thread Index | Old Index