Press any key to continue...
I would say that a || operator short-circuits the whole of the remaining expression, providing no parentheses comes into the sceene. The point is that the && operator does not behave exactly equal. A false value to the left of && will short-circuit only sucessive && operators to its right, untill the first || operator on its right.
Now the second statement is:
b1 = m1(0) && m2(1) || m3(1);
1. m1(0) is called, it is false
2. So why is the && operator not getting short circuited directly at this point?
It skips the m2(1) and goes ahead to proceed m3(1)...Why is it going ahead to preceed with the rest of the statement?
If the rule is that the whole statement has to be processed, then why did the first statement not do that?
I am really confused....please help...I am taking the exam in 2 days....