Home > Back-end >  The C language
The C language

Time:03-25

Would you please tell me why bosses don't calculate i++ first
A + + and! Operation level are equal, not a combination from right to left?

CodePudding user response:

Did you forget to writing behind the I + +?

CodePudding user response:

Oh, as to the subject, that is caused by the short circuit effect,

CodePudding user response:

refer to the second floor forever74 response:
oh, as to the subject, that is caused by the short circuit effect,

Do you have & amp; & Operator would be calculated directly from left to right?

CodePudding user response:

refer to the second floor forever74 response:
oh, as to the subject, that is caused by the short circuit effect,

Write this topic, suddenly I don't understand the operation of priority

CodePudding user response:

The operator priority is discussed combining with, use at compile time,
The order of operations, only & amp; & | |? :, exist to determine the order of the four operators, and possibly the first two, the third part will ignore expression is evaluated, this is the run-time concept,

CodePudding user response:

Priority with no definitive operation order, from the elementary school mathematics habits of thinking,
The concept of operator precedence is a primary school Chinese,


should be heardAsk a guest to stay day on rainy days leave I leave
The stem?
Place a comma in the right place is a Chinese style
Enclosed is what should combine C style
Not preferred usually enclosed also together, this is high priority
This is why int * a [3] is an array and int (* a) [3] is a pointer, the priority is to do this in,

CodePudding user response:

refer to 6th floor forever74 response:
priority with no definitive operation order, from the elementary school mathematics habits of thinking,
The concept of operator precedence is a primary school Chinese,


should be heardAsk a guest to stay day on rainy days leave I leave
The stem?
Place a comma in the right place is a Chinese style
Enclosed is what should combine C style
Not preferred usually enclosed also together, this is high priority
This is why int * a [3] is an array and int (* a) [3] is a pointer, the priority is to do this in,

Thank you so much! I understand thank you very much

CodePudding user response:

Is your problem (because the title didn't write a semicolon, I also don't write)
J=! C& & I++
It is
J=((! C) & amp; & (i++))
Mean, not
(j=! C) & amp; & (i++) or
J=(! C & amp; & I) + + or other
This is the role of operator precedence - note that we haven't started to count it, talking about how to correctly understand the formula

Really need to calculate the results, in fact the priority analysis is retired, the fourth row above tells us,
It is an assignment statement, first on the right side of the value of the expression, and then sent to j - note that we first there is the lowest priority assignment operator:
On a line in the "first" "and then" describes the execution sequence, but this is decided by the semantics of the assignment operator, and priority no relation to
Then we did not notice has to be evaluated is a logical and operation, this is our response immediately, if it is false, on the left to the right is ignored, this is logic and semantic decision

Now popular completely, return to sleep;

CodePudding user response:

refer to the eighth floor forever74 response:
is your problem, because the title didn't write a semicolon, I also don't write)
J=! C& & I++
It is
J=((! C) & amp; & (i++))
Mean, not
(j=! C) & amp; & (i++) or
J=(! C & amp; & I) + + or other
This is the role of operator precedence - note that we haven't started to count it, talking about how to correctly understand the formula

Really need to calculate the results, in fact the priority analysis is retired, the fourth row above tells us,
It is an assignment statement, first on the right side of the value of the expression, and then sent to j - note that we first there is the lowest priority assignment operator:
On a line in the "first" "and then" describes the execution sequence, but this is decided by the semantics of the assignment operator, and priority no relation to
Then we did not notice has to be evaluated is a logical and operation, this is our response immediately, if it is false, on the left to the right is ignored, this is logic and semantic decision

Now popular completely, return to sleep;

Printf (" thanks + + + + + ");
  • Related