Re: while(T[l]<p & l<=r)

Liste des GroupesRevenir à cl c  
Sujet : Re: while(T[l]<p & l<=r)
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.c
Date : 28. Mar 2024, 14:18:54
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <uu3n7d$3aoj9$1@i2pn2.org>
References : 1 2
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
Janis Papanagnou wrote:
On 27.03.2024 12:35, fir wrote:
tell me, is while(T[l]<p & l<=r) the same as while((T[l]<p)&&(l<=r))
>
1. As long as K&R precedences still hold you don't need the inner
parentheses; '<' and '<=' has higher precedence than '&' and '&&'.
2. In this case where you compare predicate expressions that
evaluate to '0' and '1' on both sides of '&' and '&&' respectively
these expressions are (while not the same) equivalent _here_. If
you don't want to operate on bits but want to express a boolean
conjunction you should use '&&', though.
>
ok tnx much this is quite solid answer
imagine i began to learn c in a week when WTC attack was (maybe like about wednesday after that if it was friday (im not sure but somethin about that) and wtill dont memrized those pices - but the answer of the above is easy to remember "<" stronger than  "&"
hovever i wopuld disagre to use "&&" instead "&" then
&& look much worse and probably & has no real disadvantages (i mean no bigger that the intention that && should be use for boolean - which probably comes from later c not oryginal young c
so i probably plan to stick to &

i was unable ro remember that
>
You could look that up if you cannot remember that. Wikipedia[*]
has a page with a lot information, and a concise list you can,
for example, find here:
https://www.cs.uic.edu/~i109/Notes/COperatorPrecedenceTable.pdf
>
Janis
>
[*] https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B
>

Date Sujet#  Auteur
27 Mar 24 * while(T[l]<p & l<=r)18fir
28 Mar 24 +* Re: while(T[l]<p & l<=r)15Janis Papanagnou
28 Mar 24 i+* Re: while(T[l]<p & l<=r)7fir
28 Mar 24 ii`* Re: while(T[l]<p & l<=r)6Janis Papanagnou
28 Mar 24 ii `* Re: while(T[l]<p & l<=r)5fir
28 Mar 24 ii  `* Re: while(T[l]<p & l<=r)4bart
28 Mar 24 ii   `* Re: while(T[l]<p & l<=r)3fir
28 Mar 24 ii    `* Re: while(T[l]<p & l<=r)2bart
29 Mar 24 ii     `- Re: while(T[l]<p & l<=r)1fir
28 Mar 24 i+* Re: while(T[l]<p & l<=r)2David Brown
28 Mar 24 ii`- Re: while(T[l]<p & l<=r)1Kaz Kylheku
30 Mar 24 i+* Re: while(T[l]<p & l<=r)3Tim Rentsch
30 Mar 24 ii`* Re: while(T[l]<p & l<=r)2fir
9 Apr 24 ii `- Re: while(T[l]<p & l<=r)1Tim Rentsch
31 Mar 24 i+- Re: while(T[l]<p & l<=r)1fir
14 Apr 24 i`- Re: while(T[l]<p & l<=r)1Phil Carmody
3 Apr 24 `* Re: while(T[l]<p & l<=r)2Peter 'Shaggy' Haywood
3 Apr 24  `- Re: while(T[l]<p & l<=r)1fir

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal