Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: I think references should have been const by default Date: Tue, 26 Oct 2021 10:22:51 -0700 Organization: None to speak of Lines: 53 Message-ID: <87r1c71z10.fsf@nosuchdomain.example.com> References: <87bl3d2dx2.fsf@nosuchdomain.example.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="b46c3160cab81c3625e1c265f36f8f38"; logging-data="9602"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4aQBZ+dFZtyyVQk7ixHQI" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:uSbIG3vUuvBp5F7quGxP7/gVGwI= sha1:Fo21RY+CDx27iZIExwfpAIcVrlc= Xref: csiph.com comp.lang.c++:82119 RacingRabbit@watershipdown.co.uk writes: > On Tue, 26 Oct 2021 10:42:24 -0400 > James Kuyper wrote: >>On 10/26/21 4:21 AM, RacingRabbit@watershipdown.co.uk wrote: >>> On Mon, 25 Oct 2021 10:48:57 -0700 >>> Keith Thompson wrote: >>>> RacingRabbit@watershipdown.co.uk writes: >>>>> Any attempt to write to a read only program text area will result in a >>crash >>>>> regardless of the language. It is implicit that its read only in C because >>>>> C also provides the following initialisation which places the string >>>>> (presumably) on the heap: >>>>> >>>>> char str[] = "hello world"; >>>> >>>> I suggest that you would benefit more here from asking questions than >>>>from making assertions. >>> >>> I suggest you ease up on being patronising. >> >>You'll get less patronizing responses when you cease displaying such an >>abysmal understanding of C, while believing you understand it better >>than others. > > Says the preening fool. James is not a "preening fool". He's right. You have joined a forum many of whose participants are experts on the C programming language. You have made a number of incorrect statements about C, and you have shown an inappropriately condescending attitude while doing so. This is a great place to learn about C, and I sincerely hope you'll take advantage of the opportunity. My advice is to express less certainty about the statements you make, engage in discussion, and stop insulting people. >>Your right, but for the wrong reasons. It's true that *str isn't >>modifiable, but that's not just because of the "*", it's because str has >>been initialized to point at the first character of a string literal. It > > So you disagree with what I said then say exactly the same thing yourself. No, that's not what he did. The array is read-only because it's a string literal. You didn't say that. > Ok, well thanks for that. Helpful. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips void Void(void) { Void(); } /* The recursive call of the void */