*x则是定义地址,*x++实际是X储存的地址的下一位, 意思就是把y储存的地址的下一位赋值给X储存的地址的下一位 # include <stdio.h> int main(void) { int x=30,*y,*z; y=&x; z=y; *y=*z; printf("%d %d %d ",x,y,z); printf("\n"); *y++ = *z++; x++; printf("%d %d %d ",x,y,z); printf("\n"); return 0; } ![]() # include <stdio.h> int main(void) { int x=30,*y,*z; y=&x; z=y; *y=*z; printf("%d %d %d ",x,y,z); printf("\n"); *y++ = *z; x++; printf("%d %d %d ",x,y,z); printf("\n"); return 0; } ![]() |
|
来自: 行者hydraulics > 《MATLAB》