Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.c,comp.programming Subject: Re: C is not a low level language Date: Mon, 25 Feb 2019 14:12:12 +0000 Organization: A noiseless patient Spider Lines: 25 Message-ID: <87k1ho2c03.fsf@bsb.me.uk> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="832d9de94d0be5182104bfbcfc295eb5"; logging-data="16212"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tgqoOiEDOEl0A60r+5GMF3Fy5JPbiLg8=" Cancel-Lock: sha1:gIoGW1ksYq01AiWkFOTskhDuBxQ= sha1:IMEYxtKISvhE7NDj0no87+TGzfc= X-BSB-Auth: 1.af24eab698eae05c7418.20190225141212GMT.87k1ho2c03.fsf@bsb.me.uk Xref: csiph.com comp.lang.c:141306 comp.programming:9705 "R.Wieser" writes: >> In case you didn't notice, the terminating null is not stored > > Really ? Good luck with "printf" -ing such a non-terminated string than. > :-) You can safely use printf with such non-strings: #include #include int main(void) { char s[11]; strncpy(s, "hello world", sizeof s); printf("%.*s\n", (int)sizeof s, s); } (Your reply breaks a sentence to give it a meaning that was no intended, but even so, I think it's useful to point out the printf can be used with some non-strings.) -- Ben.