Home > Back-end >  If (count==k) what meaning be?
If (count==k) what meaning be?

Time:03-07

count++;
If (count==k) and the if (count++==k) results are the same? Why is that?

CodePudding user response:

+ + count and count++ when used alone is count=count + 1
A=+ + count; Equivalent to count=count + 1; A=count;
A=count++; The equivalent of a=count; Count=count + 1;

CodePudding user response:

The result is not the same, count++; If (count==k) compared with the if (count++==k), the former is used after the count + 1 values compared with k, the latter for the count value compared with k

CodePudding user response:

Not the same, count++ as increase and k again after comparison
  • Related