#include <stdio.h>
int main()
{
int a = 4;
printf("a=4\n");
printf("(a)*(++a)=%d\ta=%d\n",(a)*(++a),a);
a = 4;
printf("(++a)*(++a)=%d\ta=%d\n",(++a)*(++a),a);
a = 4;
printf("(a++)*(a++)=%d\ta=%d\n",(a++)*(a++),a);
a = 4;
printf("(a++)*(a)=%d\ta=%d\n",(a++)*(a),a);
scanf("%d",&a);
}
Disassembly:
Screenshot operating results:
The results show that, if an expression preincrement symbol exists, first increment operation are sequentially performed, then since the value calculated by the expression. For example, when a = 4 (a) * (++ a) is equal to 25 instead of 4 * 5 = 20. Post increment symbol Similarly, the first calculation expression with the value of the original value, the last increment sequentially performed operations.
Today you
Ju Master said
that?
Reproduced in: https: //www.cnblogs.com/mashang/archive/2011/03/24/1993509.html