1

Apologize for ambiguous title but I simply did not know how else to put it.

Anyway, I want a piece of code to do the same thing this does in one line (in an if statement)

ret= fee(XYZ);
if((fii(ret) && foh(ret)) !=0)
{
  //do something
}

like put all that into something like

if(_______FUM________)    
{
  //do the same thing
 }

Is there anything I can do for this? The answer is probably staring at me in my face. But I am stuck here.

4

1 回答 1

3

您可以使用逗号运算符

if(ret = fee(XYZ), (fii(ret) && foh(ret)) !=0)

但为什么?!

(此外,!=0似乎是多余的。)

于 2013-10-24T11:12:09.603 回答