c语言中的&运算符做形参相关

#include<iostream.h>

#include<stdio.h>

 

voidswap(int &x,int &y);

 

intmain()

{

inta=10;

intb=5;

swap(a,b);

cout<<a<<""<<b<<endl;

 

getchar();

}

 

voidswap(int &x,int &y)

{

x=55;

y=55;

}

输出55 55

posted on 2011-05-28 18:10  xuq  阅读(173)  评论(0编辑  收藏  举报

导航