1. i++为后自增 整体表达式的值为自增之前的值
2. ++i为前自增 整体表达式的值为自增后的值
# include <stdio.h> int main(void) { int a,b,c,d; a = b = 3; c = a++; d = ++b; printf("a = %d b = %d c = %d d = %d\n",a,b,c,d); return 0; }
输出结果为 a = 4 b = 4 c = 3 d= 4
标签:log include ret return clu main 结果 post oid
1. i++为后自增 整体表达式的值为自增之前的值
2. ++i为前自增 整体表达式的值为自增后的值
# include <stdio.h> int main(void) { int a,b,c,d; a = b = 3; c = a++; d = ++b; printf("a = %d b = %d c = %d d = %d\n",a,b,c,d); return 0; }
输出结果为 a = 4 b = 4 c = 3 d= 4
标签:log include ret return clu main 结果 post oid
原文地址:https://www.cnblogs.com/mycgy/p/8440937.html