#includeint main(void){ int j, i = 3; printf("j = %d\n", j = (++i) + (++i) + (++i)); i = 3; printf("j = %d\n", j = (i++) + (i++) + (i++)); i = 3; printf("j = %d\n", j = (++i) + (i++) + (++i)); return 0;}/* 结果: * j = 16 * j = 9 * j = 13 * */
#include#define SQUARE(x) ((x)*(x))int main(void){ int a = 5; int b, c; b = SQUARE(a++); a = 5; c = SQUARE(++a); printf("b: %d, c: %d\n", b, c); a = 5; b = (a++)*(a++); a = 5; c = (++a)*(++a); printf("b: %d, c: %d\n", b, c); a = 5; b = (a++)*(a++)*(a++); a = 5; c = (++a)*(++a)*(++a); printf("b: %d, c: %d\n", b, c); a = 5; b = (a++)*(a++)*(++a); a = 5; c = (++a)*(a++)*(++a); // 6*6*7 ?
?
? a = 5; c = (++a)*(a++); // 6*6 ??
?
printf("b: %d, c: %d\n", b, c); return 0; }
运行结果:b: 25, c: 49
b: 25, c: 49 b: 125, c: 392 b: 150, c: 36++ 什么是法律表达式求值?
反编译它?
版权声明:本文博客原创文章。博客,未经同意,不得转载。