`if(!p?i ++:0)break;'==`if(!p){i ++;打破;}'? [英] `if (!p ? i++ : 0) break;' == `if (!p){ i++; break;}' ?
问题描述
以下两条线是否相等?假设表达式i ++没有
溢出。它们在我的代码中表现不同。
if(!p?i ++:0)break;
if(!p){i ++;
感谢您的时间。
Are the following two lines equal? Suppose the expression i++ doesn''t
overflow. They behave differently in my code.
if (!p ? i++ : 0) break;
if (!p){ i++; break;}
Thank you for your time.
推荐答案
" lovecreatesbea ... @ gmail.com" < lo *************** @ gmail.com写信息
新闻:76 *************** ******************* @ l28g2000 prd.googlegroups.com ...
"lovecreatesbea...@gmail.com" <lo***************@gmail.comwrote in message
news:76**********************************@l28g2000 prd.googlegroups.com...
以下两行等于?假设表达式i ++没有
溢出。他们的代码表现不同。
Are the following two lines equal? Suppose the expression i++ doesn''t
overflow. They behave differently in my code.
真正的C专家会在一分钟内出现,但让我们看看:
The real C experts will come along in a minute, but let''s see:
if(!p?i ++:0)break;
if (!p ? i++ : 0) break;
当p为假且i(在增量前)为真时,这将中断。
This will break when p is false and i (before the increment) is true.
> ;
if(!p){i ++; break;}
>
if (!p){ i++; break;}
当p为假时,这会中断。
正在使用p和i的值是什么? br />
-
巴特
This will break when p is false.
What values of p and i are being used?
--
Bart
lovecreatesbea ... @ gmail.com写道:
lovecreatesbea...@gmail.com wrote:
以下两行是否相等?假设表达式i ++没有
溢出。它们在我的代码中表现不同。
if(!p?i ++:0)break;
if(!p){i ++; break;}
Are the following two lines equal? Suppose the expression i++ doesn''t
overflow. They behave differently in my code.
if (!p ? i++ : 0) break;
if (!p){ i++; break;}
它们不等同。考虑一下i == 0的情况。
-
Eric Sosman
es ***** @ ieee-dot-org.inva lid
They are not equivalent. Consider the case i==0.
--
Eric Sosman
es*****@ieee-dot-org.invalid
On 4 ??13è?, ????10ê±30·?,lovecreatesbea ... @ gmail.com
< lovecreatesbea ... @ gmail.comwrote:
On 4??13è?, ????10ê±30·?, "lovecreatesbea...@gmail.com"
<lovecreatesbea...@gmail.comwrote:
以下两行是否相等?假设表达式i ++没有
溢出。它们在我的代码中表现不同。
if(!p?i ++:0)break;
if(!p){i ++; $;
谢谢您的时间。
Are the following two lines equal? Suppose the expression i++ doesn''t
overflow. They behave differently in my code.
if (!p ? i++ : 0) break;
if (!p){ i++; break;}
Thank you for your time.
是的,它是相同的,但是关键字break不在if的块中......
Yes ,It''s equal,but keyword "break" is not in the block of "if"...
这篇关于`if(!p?i ++:0)break;'==`if(!p){i ++;打破;}'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!