引用调用

/*  应用调用采用地址传递

*/
#include <iostream>
using namespace std;
void swap(int &a,int &b)
{
    int t;
    t=a;
    a=b;
    b=t;
}
int main()
{
    int x=8,y=5;
    cout<<x<<"    "<<y<<endl;
    swap(x,y);
    cout<<x<<"    "<<y<<endl;
}

原文地址:https://www.cnblogs.com/lzh-Linux/p/3480416.html