我有个疑问 [英] I have a doubt
问题描述
大家好,
如果我有:
if(A&& B || C)
首先执行哪个操作?
如果我记得很好应该是&&,我是否正确?
谢谢
Ivan
hi all,
if I have:
if(A && B || C)
which operation gets executed first?
If I remeber well should be &&, am I correct?
thanks
Ivan
推荐答案
ivan说:
ivan said:
hi全部,
如果我有:
if(A&& B || C)
首先执行哪个操作?
hi all,
if I have:
if(A && B || C)
which operation gets executed first?
参见K& R2的第21和53页。第21页有关您问题的详细解答,
和第53页有更通用的答案。
-
Richard Heathfield
Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk
电子邮件:rjh在上述域名中, - www。
See pages 21 and 53 of K&R2. Page 21 for a detailed answer to your question,
and page 53 for a more generic answer.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
ivan写道:
ivan wrote:
大家好,
如果我有:
if(A&& B || C)
首先执行哪个操作?
hi all,
if I have:
if(A && B || C)
which operation gets executed first?
A首先被评估。
A is evaluated first.
如果我记得很好应该是&&,我是正确?
If I remeber well should be &&, am I correct?
直到A被评估为止。
Not until A is evaluated.
" Martin Ambuhl" < ma ***** @ earthlink.netha scritto nel messaggio
news:4t ************* @ mid.individual.net ...
"Martin Ambuhl" <ma*****@earthlink.netha scritto nel messaggio
news:4t*************@mid.individual.net...
ivan写道:
ivan wrote:
大家好,
如果我有:
if(A&& B || C)
首先执行哪个操作?
hi all,
if I have:
if(A && B || C)
which operation gets executed first?
A首先被评估。
A is evaluated first.
如果我记得很好应该是&&,我是正确?
If I remeber well should be &&, am I correct?
直到A被评估。
Not until A is evaluated.
抱歉,我手边没有C书。
我所说的是:
A&& B || C $ / $
与以下相同:
(A&& B)|| C
或相同:
A&&(B || C)
sorry but i do not have a C book at hand.
what I am saing is:
A && B || C
is the same as:
(A&&B)||C
or the same as:
A&&(B||C)
这篇关于我有个疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!