Home > Back-end >  Why I didn't add the second one, but directly is equal to the value after an I?
Why I didn't add the second one, but directly is equal to the value after an I?

Time:05-11

CodePudding user response:

Because s1 [i++] is first i++ as overall value as the s1 in the table below, and then change the value of the I, reason is that since the increase is the increase of here, if it is + + I is on the contrary,

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html

CodePudding user response:

The root of the problem is a lot of people don't realize that, , expression is a value in a larger expression, operator operation the value of the expression as , if need be, any expression has a value, even void expression, also can have a value (empty),

I + + the value of the expression is the increasing lvalue I the original value before the , at the same time, the expression has a will I stored value plus one side effects, therefore,
 x=I + +; 

Is to assign expression the value of I + + x (I stored value increment) at the same time, the traditional explanation is to assign the value of the I to x, then I could, but it cannot be logically explained, and + + I are combined, what makes it, have any obligation to put their own value is assigned to the left of x? After all, the assignment operator of the right operand is the I + + instead of I,

expression is increasing lvalue I after new value , at the same time, the expression has a will I stored value plus one side effects, therefore,
 x=+ + I; 

Is to assign the value of the expression + + I x (I stored value increment) at the same time, the traditional explanation is increasing first, then I assign x, but it also cannot be logically explained, and + + I are combined, it is the obligation of increasing according to the requirements of + + to complete, what makes it, have any obligation to increase the value assigned to the left after the x? After all, the assignment operator of the right operand is + + I, not I,
  • Related