Path: ...!weretis.net!feeder9.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: bart Newsgroups: comp.lang.c Subject: =?UTF-8?Q?Re=3A_technology_discussion_=E2=86=92_does_the_world_need?= =?UTF-8?B?IGEgIm5ldyIgQyA/?= Date: Fri, 12 Jul 2024 14:59:01 +0100 Organization: A noiseless patient Spider Lines: 46 Message-ID: References: <877cdur1z9.fsf@bsb.me.uk> <871q42qy33.fsf@bsb.me.uk> <87ed82p28y.fsf@bsb.me.uk> <87r0c1nzjj.fsf@bsb.me.uk> <86ikxd8czu.fsf@linuxsc.com> <20240710213910.00000afd@yahoo.com> <865xtc87yo.fsf@linuxsc.com> <87msmnu5e3.fsf@nosuchdomain.example.com> <87frsfu0yp.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 12 Jul 2024 15:59:01 +0200 (CEST) Injection-Info: dont-email.me; posting-host="70309d0afdade4e9fabfb798d5d70205"; logging-data="3212083"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uyici0cg6gjlQO4IgLn0Y" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:j5Pl5uX6OjMy6OnvXLZDytVX6w8= Content-Language: en-GB In-Reply-To: Bytes: 3263 On 12/07/2024 12:44, Janis Papanagnou wrote: > On 11.07.2024 22:37, bart wrote: >> On 11/07/2024 21:29, Keith Thompson wrote: >>> bart writes: >>>> >>>> This my first comment on the subject: >>>> >>>> "Arrays are passed by reference: >>>> ... >>>> Although ..." >>> >>> And that statement was incorrect, even with the "Although". >> >> So arrays are passed by value? Gotcha. > > Neither is true. - Tertium datur! > > "Array passing" is in "C" realized using a pointer passing > mechanism where the pointer is passed "by value". > > Neither an array is passed [by value] nor there's a "call > by reference" mechanism in "C". So how are the elements of the caller's array accessed? No copies have been supplied to the caller. So access is by ... ? Look, there are only two choices: 'pointer' and 'reference', which in C are more or less the same thing: "6.2.5p20 ... A pointer type describes an object whose value provides a reference to an entity of the referenced type." So I said 'arrays are passed by reference'; maybe I should have said 'array elements are passed by reference' (which suggests that each has its own reference), so shoot me. But everyone was so keen to prove me wrong and incapable of understanding. > This has been explained (also with references to original > sources) to you many times. Could you be a bit more patronising, please?