#include struct ord { int x,y;} dt[2]={1,2,3,4}; main() {struct ord *p=dt; printf("%d,",++#includestruct ord {int x,y;} dt[2]={1,2,3,4};main(){struct ord *p=dt;printf("%d,",++p->x);printf("%d,",++p->y);}++p->x++p->y

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/21 23:48:29
#includestructord{intx,y;}dt[2]={1,2,3,4};main(){structord*p=dt;printf("%d,",++#includestructord{int

#include struct ord { int x,y;} dt[2]={1,2,3,4}; main() {struct ord *p=dt; printf("%d,",++#includestruct ord {int x,y;} dt[2]={1,2,3,4};main(){struct ord *p=dt;printf("%d,",++p->x);printf("%d,",++p->y);}++p->x++p->y
#include struct ord { int x,y;} dt[2]={1,2,3,4}; main() {struct ord *p=dt; printf("%d,",++
#include
struct ord
{
int x,y;} dt[2]={1,2,3,4};
main()
{struct ord *p=dt;
printf("%d,",++p->x);
printf("%d,",++p->y);
}
++p->x
++p->y

#include struct ord { int x,y;} dt[2]={1,2,3,4}; main() {struct ord *p=dt; printf("%d,",++#includestruct ord {int x,y;} dt[2]={1,2,3,4};main(){struct ord *p=dt;printf("%d,",++p->x);printf("%d,",++p->y);}++p->x++p->y
取值运算的优先级高于++
++p->x
++p->y
的含义等同于
++(p->x)
++(p->y)
前缀++,--与后缀++,--的区别在于
++i时,i=i+1,既i自增之后使用i
而i++表示,i=i,i=i+1既先使用i,然后i自增1