Home > Back-end >  'don't think that is a bit of new
'don't think that is a bit of new

Time:09-26

Why not take out the pointer p values from the first to give y assignment, but the increase again ascribed to y, since the increase since decreases is not higher than the priority assignment

CodePudding user response:

Rear + + line is to execute the statement is executed

CodePudding user response:

P * pointer to the first element of a array a [1]

Expressions: y=(* p) + +;

1. The priority of the brackets is greater than the "+ +", first computing the expression in brackets (* p)
2. * with - the same priority, by combining the direction is to the left, the first operation ", "
3. - p is a former reduction, so the first pointer p do shift operation, reach a position (int), then the pointer p point to the zeroth element of the array a a [0]
4. Then I do * take the contents of the operation, the data obtained is a [0], for 5
5. See below the parentheses after the operator + +, it is after the increase, is the first operation of the current expression, since increased again, also is the first to y assignment ((* p) assigned to y, y=5), and then on the ((* p) since, is a [0] since, is a [0] is 6)

CodePudding user response:

refer to the second floor snail thousand Long reply:
p * pointer to the first element of a array a [1]

Expressions: y=(* p) + +;

1. The priority of the brackets is greater than the "+ +", first computing the expression in brackets (* p)
2. * with - the same priority, by combining the direction is to the left, the first operation ", "
3. - p is a former reduction, so the first pointer p do shift operation, reach a position (int), then the pointer p point to the zeroth element of the array a a [0]
4. Then I do * take the contents of the operation, the data obtained is a [0], for 5
5. See below the parentheses after the operator + +, it is after the increase, is the first operation of the current expression, since increased again, also is the first to y assignment ((* p) assigned to y, y=5), then the increase ((* p) since, is a [0] since, is a [0] is 6)

Picture on the left associativity

CodePudding user response:

reference qq_47279096 reply: 3/f
Quote: refer to the second floor snail thousand Long reply:
p * pointer to the first element of a array a [1]

Expressions: y=(* p) + +;

1. The priority of the brackets is greater than the "+ +", first computing the expression in brackets (* p)
2. * with - the same priority, by combining the direction is to the left, the first operation ", "
3. - p is a former reduction, so the first pointer p do shift operation, reach a position (int), then the pointer p point to the zeroth element of the array a a [0]
4. Then I do * take the contents of the operation, the data obtained is a [0], for 5
5. See below the parentheses after the operator + +, it is after the increase, is the first operation of the current expression, since increased again, also is the first to y assignment ((* p) assigned to y, y=5), then the increase ((* p) since, is a [0] since, is a [0] is 6)

Picture on the left associativity

You go to check the priority list oh, look at the operator *, -, + + direction of the combination of

CodePudding user response:

A=b++;
Is first performed b++;
But before the return to a value is b++ value,

CodePudding user response:

+ + is a rear
After is the rear end of the statement on the increase

CodePudding user response:

Before the increase or decrease the priority of higher than the assignment, since there is a condition that increase or decrease after this line after the statement execution will perform, first get p0 address - p, five values, in (* p) + +
  • Related