Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.c Subject: Re: Implicit String-Literal Concatenation Date: Thu, 7 Mar 2024 21:08:48 -0000 (UTC) Organization: A noiseless patient Spider Lines: 16 Message-ID: References: <87frxcuv87.fsf@nosuchdomain.example.com> <87o7bzrll5.fsf@nosuchdomain.example.com> <87bk7ysysj.fsf@nosuchdomain.example.com> <87y1axp9a7.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 7 Mar 2024 21:08:48 -0000 (UTC) Injection-Info: dont-email.me; posting-host="63d07f27dc2a6beb992a482a5dec0d77"; logging-data="1324995"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bBzLp5fNhuHFT6mX9Enq4" User-Agent: Pan/0.155 (Kherson; fc5a80b8) Cancel-Lock: sha1:vln3hIGmK0PHCW6GkVRmTQUj7Bg= Bytes: 1982 On Mon, 04 Mar 2024 20:55:28 -0800, Keith Thompson wrote: > Lawrence D'Oliveiro writes: > >> On Thu, 29 Feb 2024 14:14:52 -0800, Keith Thompson wrote: >> >>> "A *string* is a contiguous sequence of characters terminated by and >>> including the first null character." >> >> So how come strlen(3) does not include the null? > > Because the *length of a string* is by definition "the number of bytes > preceding the null character". So the “string” itself includes the null character, but its “length” does not?