1 # include <stdio. h> 2 int main () 3 {4 int A = 5; 5 A = (a = 3*5, a * 4), a + 5; 6 printf ("A = % d \ n", a); 7 int B = 5; 8 B = (B = 3*5, B * 4 ), B + 5); 9 printf ("B = % d \ n", B); 10 return 0; 11}
A = 60;
B = 20;
Expression 1, expression 2, expression 3, ------ expression N;
The evaluation process is to first obtain the value of N expressions from left to right, and take the value of N expressions as the value of the whole expression. If there are Parentheses, the values in the brackets are calculated first. The calculation level of the comma expression is the lowest, and the priority of the value assignment operator is higher than that of the comma expression.
First Statement
First a = 15, then, a = 60;
The second formula
B = 15 first, because no value is assigned to the result of the brackets
B = (B = 15,60), B + 5 );
B = (60, 20 );
B = 20;