Path: ...!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: Wed, 17 Jul 2024 12:38:15 +0100 Organization: A noiseless patient Spider Lines: 74 Message-ID: References: <877cdur1z9.fsf@bsb.me.uk> <871q42qy33.fsf@bsb.me.uk> <87ed82p28y.fsf@bsb.me.uk> <87r0c1nzjj.fsf@bsb.me.uk> <87ikxconq4.fsf@bsb.me.uk> <20240711115418.00001cdf@yahoo.com> <20240712154252.00005c2f@yahoo.com> <86o7717jj1.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 17 Jul 2024 13:38:15 +0200 (CEST) Injection-Info: dont-email.me; posting-host="bf2146295ce154b402888450fc1558ab"; logging-data="1921999"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18F6/yShFpd5r1KSx9JqQi4" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:jPztXE5nbsu/Pwy+irMoUqTRBoE= In-Reply-To: Content-Language: en-GB Bytes: 3910 On 13/07/2024 10:39, BGB wrote: > But, as I see it, no real point in arguing this stuff (personally, I > have better stuff to be doing...). We all do. But this group seems to be about arguing about pointless stuff and you might come here when you want a respite from proper work. However (here I assume you've gone back to Quake but that other interested parties might be reading this), consider the program below. That sets up an array and then sums its elements by calling 3 different functions to do the job: (1) Using normal C pass-by-value (2) Using C pass-by-value to emulate call-by-reference (3) Using fantasy true call-by-reference as it might appear if C had the feature (I'd hoped C++ would run this, but it didn't even like the middle function.) I'm asking people to compare the first and third functions and their calls, and to see if there's any appreciable difference between them. There will obviously be a difference in how the A parameter is declared. --------------------------------------------- #include typedef int T; int sum_byvalue(T* A, int n) { int i, sum=0; for (i=0; i