大家帮忙看下这个程序!
#include <stdio.h>#include <stdlib.h>
int main()
{
int *pn,n,m;
printf("请输入n=");
scanf("n=%d",&n);
pn=&n;printf("pn=%d\n",pn);
m=*pn++; printf("m=%d",m);printf("pn=%p",pn);printf("m=%p\n",m);
m=*++pn; printf("m=%d",m);printf("m=%p\n",m);
m=(*pn)++;printf("m=%d",m);printf("m=%p\n",m);
m=++(*pn);printf("m=%d",m);printf("m=%p\n",m);
system("pause");
}
m=*++pn; printf("m=%d",m);printf("m=%p\n",m);
m=(*pn)++;printf("m=%d",m);printf("m=%p\n",m);
这两行运行的确一样的,怎么回事来的?
m=*++pn; printf("m=%d",m);printf("m=%p\n",m);这行不太懂来的?请问各位高手是什么意思来的?
m=(*pn)++;printf("m=%d",m);printf("m=%p\n",m);这行是不是先用指针,再在指针的值上加1呀?