Be careful when combining increment and decrement operators inside expressions with logical operators. If in doubt, don't use them together. For example, do NOT use:
if (( num1 = = 4 ) || ( num2 != ++j)) (j may not be incremented when (num1 = = 4) is TRUE.)Instead, separate the code to avoid this problem:
++j;
if (( num1 = = 4) || (num2 != j))
0 comments:
Post a Comment