1. Expression: The expression is called by using an operator to connect the constants, variables, and functions according to certain rules.
Classification: An expression contains relational operators, arithmetic operators, logical operators (P: Expressions must all have return values) ...
Expression statement: The expression is followed by a semicolon ";", which constitutes an expression statement.
2. Assignment operator = (Combination direction: Right to left):
int A, B, C; a=b=c=0;printf ("a=%d,b=%d,c=%c", a,b,c);//output result is a=0,b=0,c=0;
1 int A =b=c=1; 2 printf ("a=%d,b=%d,c=%d", a,b,c); 3 // error, because the assignment operator of the direction of the Union: Right to left, 1 is assigned to C, at the moment C is not explained;
3. Self-increase self-reduction x++,++x;
int x=1= x + +;p rintf ("result=%d,x=%d", Result,x ); // The output result is result=0,x=1;
int x=0; result;result=++x;printf ("result=%d,x=%d" , result,x); // The output result is: result=1,x=1;
4.sizeof
Used to calculate the number of bytes in memory for constants, variables, data types
sizeof (constant/variable), sizeof constant/variable (used in constants or variables, and ellipsis brackets), sizeof (data type)
int 9 sizeof(num); // can be result = sizeof num; printf ("result=%d", result); // output is result=4 sizeof(double);p rintf ("result=%d", result); // The output result is result=8;
5. The evaluation procedure for a comma expression: the value of the expression is evaluated one after the other, and then the value of the last expression is returned. The value as a comma expression.
int A, b,sum,result;a=b=5= (a++,b-a,sum=a+b);p rintf ("a=%d,b=%d,sum= %d,result=%d", A,b,c,result); // output a=6,b=5,c=-1,result=11;
C-expression assignment self-increment-decrement sizeof comma expression