引用2楼棉猴的回复:《C++Primer第五版中文版》中提到
操作符*叫做解引用符,如果指针指向了一个对象,则允许使用解引用符来访问该对象。对指针解引用会得出所指向的对象。
你的代码写的挺不错的,我稍微改了下
#include
intadd(int*p,int*q);
intmain()
{
inta,e,c;
printf("输入两个数:\n");
scanf("%d%d",&a,&e);
c=add(&a,&e);
printf("%d\n",c);
return0;
}
intadd(int*p,int*q)
{
intt;
t=*p+*q;
returnt;
}
以下是在VS2015中调试的结果
大神所谓的挺不错指的是什么?从哪几行代码看出来的?
|