if statement - if(a,b,c,d) how does this work? -
this question has answer here:
- what comma operator , do? 8 answers
int main(void) { int a=0, b=20; char x=1, y=10; if(a,b,x,y) printf("bye"); return 0; }
how "if" condition in above code work work? value of "y" considered "if"?
yes, value of comma operator right operand. because none of other operands have side effects, boils down if (y)
.
Comments
Post a Comment