I tried the following with ternary operator and I do not understand why it is not compiling. The issue seems so small but I do not understand and hence bothers me -
Line 1 --> int a = false ? y+=1 : (x*=10);
Line 2 --> int b = false ? y+=1 : x*=10;
Line 1 compiles however Line 2 does not. Why ?
How is the parenthesis making a difference in case of 3rd operand and not the second operand. I didn't have to use parenthesis with anything else in the 2nd / 3rd operands (Unary, string, basic arithmetic ...) Why just assignment operator and that too specifically 3rd operand ?
Thanks in advance !