Sujet : Re: Checking the loop variable after the loop has ended (Was: Loops (was Re: do { quit; } else { }))
De : richard.nospam (at) *nospam* gmail.invalid (Richard Harnden)
Groupes : comp.lang.cDate : 25. Apr 2025, 07:04:53
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vuf8m5$3bk45$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla Thunderbird
On 25/04/2025 06:50, Janis Papanagnou wrote:
On 24.04.2025 22:43, Rosario19 wrote:
On Fri, 18 Apr 2025 16:07:03 +0100, bart wrote:
>
for (n = NUM_ENTRIES; (n >= 0) && (node[n] != key); --n) continue;
>
using goto label would be as this
>
n=NUM_ENTRIES
L: if(!((n >= 0) && (node[n] != key))) goto Ex
--n; goto L;
Ex:
>
You are just showing a low-level transformation of a higher-level
construct. (I'm sure the professional folks here are familiar with
such transformations.)
You are not [seriously] suggesting to use that 'goto' based form
instead of the 'for' loop, do you?
That's exactly the kind of thing that should be considered harmful.