新手问题,关于c调用问题。
#include <iostream>
void swap(int &rx,int &ry) //此处不是调用地址吗?为什么在下面的swap处调用的是数x与y;能给解释一下吗?
{int temp;
temp=rx;
rx=ry;
ry=temp;
}
void main()
{int x,y;
cout<<"输入x与y:"<<endl;
cin>>x>>y;
swap(x,y); //若是在此处输入swap(&x,&y);编译时报错
cout<<"x="<<x<<'\t'<<"y="<<y<<endl;
}