Web for Nerds !!!

Evaluate a=b+++++c;

How will a ANSI C compiler parse the following C snippet ?

a=b+++++c;

Select the right answer

(i) a = (b++) + (++c); // because of common sense
(ii) a = ((b++)++) + c ; // evaluated left to right
(iii) a = b + (++(++c)); // evaluated right to left because of unary operator
(iv) error: lvalue required as increment operand
Reference Try it online
Leave a Reply

You must be logged in to post a comment.