#include <iostream>
using namespace std;
void swap(int &v1,int&v2)
{
int temp;
temp=v1;
v1=v2;
v2=temp;
}
int main()
{
int x,y;
cout<<"please enter two value:"<<endl;
cin>>x>>y;
cout<<"x="<<x<<endl<<"y="<<y<<endl;
swap(x,y);
cout<<"after swap:"<<endl
<<"x="<<x<<endl<<"y="<<y<<endl;
return 0;
}
这个函数调用怎么理解?形参是什么?实参是怎么传进去并交换的?