这是引用??
对C研究不深,最近遇到个问题,不能理解,忘指教swap(int* &a,int* &) //不知道是不是我脑袋卡壳了啊。这不会是引用吧,C语言里面没有的吧。那怎么解释呢?
验正:
程序代码:#include
#include
void output(int* &a,int* &b)
{
printf("%d ",a);
printf("%d \n",b);
int temp;
temp=*a;
*a=*b;
*b=temp;
}
int main()
{
int *a,*b,c=8,d=9;
a=&c;
b=&d;
output(a,b);
printf("%d %d \n",a,b);
system("pause");
return 0;
}
输出的都是地址。
[ 本帖最后由 锋了 于 2013-5-9 15:39 编辑 ]








