#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/06/30 11:43:44
![#include struct ord { int x,y;} dt[2]={1,2,3,4}; main() {struct ord *p=dt; printf(](/uploads/image/z/1101065-41-5.jpg?t=%23include+struct+ord+%7B+int+x%2Cy%3B%7D+dt%5B2%5D%3D%7B1%2C2%2C3%2C4%7D%3B+main%28%29+%7Bstruct+ord+%2Ap%3Ddt%3B+printf%28%22%25d%2C%22%2C%2B%2B%23includestruct+ord+%7Bint+x%2Cy%3B%7D+dt%5B2%5D%3D%7B1%2C2%2C3%2C4%7D%3Bmain%28%29%7Bstruct+ord+%2Ap%3Ddt%3Bprintf%28%22%25d%2C%22%2C%2B%2Bp-%3Ex%29%3Bprintf%28%22%25d%2C%22%2C%2B%2Bp-%3Ey%29%3B%7D%2B%2Bp-%3Ex%2B%2Bp-%3Ey)
#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