| Deutsch English Français Italiano |
|
<865xs54fak.fsf@linuxsc.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!feeds.phibee-telecom.net!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch <tr.17687@z991.linuxsc.com> Newsgroups: comp.lang.c Subject: Re: relearning C: why does an in-place change to a char* segfault? Date: Mon, 12 Aug 2024 14:11:47 -0700 Organization: A noiseless patient Spider Lines: 11 Message-ID: <865xs54fak.fsf@linuxsc.com> References: <IoGcndcJ1Zm83zb7nZ2dnZfqnPWdnZ2d@brightview.co.uk> <v8fhhl$232oi$1@dont-email.me> <v8fn2u$243nb$1@dont-email.me> <87jzh0gdru.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Mon, 12 Aug 2024 23:11:47 +0200 (CEST) Injection-Info: dont-email.me; posting-host="f42e4005105099d89c60a754521770ce"; logging-data="3643568"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18me7oAsFyYxeBOrMRvurBt7L5DkjRcR9A=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:6O3O338rKNEKjV/qrvRj15G6Fi4= sha1:qpReUcQb05Q5+YhPCP/NfV/awiE= Bytes: 1531 Keith Thompson <Keith.S.Thompson+u@gmail.com> writes: [...] > A string literal creates an array object with static storage > duration. [...] A small quibble. Every string literal does sit in an array, but it might not be a _new_ array, because different string literals are allowed to overlap as long as the bytes in the overlapping arrays have the right values.