C++ uses short circuit evaluation, if the whole conditions's result is known, the compiler do not waste to check the rest. Likeif(b<2 && (a=a+1)) printf("X\n"); never print, because a=a+1 never happen. So the compiler does not waste time to check the rest.