Sujet : Re: while(T[l]<p & l<=r)
De : phaywood (at) *nospam* alphalink.com.au (Peter 'Shaggy' Haywood)
Groupes : comp.lang.cDate : 03. Apr 2024, 00:25:55
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <3pgudk-e4a.ln1@hendrix.foo>
References : 1
User-Agent : KNode/0.10.9
Groovy hepcat fir was jivin' in comp.lang.c on Wed, 27 Mar 2024 10:35
pm. It's a cool scene! Dig it.
tell me, is while(T[l]<p & l<=r) the same as while((T[l]<p)&&(l<=r))
i was unable ro remember that
You're forgetting that && is a so-called "short circuit" operator. If
the left operand is false, then the right operand is not evaluated.
This makes little difference in this particular case; but what if you
had something like this instead?
while(some_function() < p && some_other_function() <= r)
Here some_other_function() will not be called if the some_function()
call returns a value >= p.
-- ----- Dig the NEW and IMPROVED news sig!! ------------------- Shaggy was here! ---------------
Ain't I'm a dawg!!