这个问题它的计算过程是什么样的啊?如果把++k改成k++结果为什么是一样的?
#include
#include
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int f(int m)
{
int k=2;
++k;
return k+m;
}
void main()
{
int s;
s=f(2);
printf("%d,%d\n",s,f(s));
}
独立使用中前置++和后置++没啥区别。只有参与到运算中才会有区别。