Sujet : Re: Checking the loop variable after the loop has ended (Was: Loops (was Re: do { quit; } else { }))
De : Ros (at) *nospam* invalid.invalid (Rosario19)
Groupes : comp.lang.cDate : 25. Apr 2025, 09:38:03
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <34im0k15a0s3i00o624egnp1b7uje23svp@4ax.com>
References : 1 2 3 4 5 6 7 8
User-Agent : Forte Free Agent 1.93/32.576 English (American)
On Thu, 24 Apr 2025 22:43:32 +0200, 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:
n=NUM_ENTRIES
L: if(n<0 || node[n]==key)goto Ex; --n; goto L;
Ex:
this is more clear of above... yes if one is accostumated to use
for(;;) loop this would be better
for(n=NUM_ENTRIES;n>=0 && node[n]!=key; --n);