按引用传递参数

#include <iostream>
using namespace std;

void sneezy(int &x)
{
	x += 20;
}
int main()
{
	int times = 20;
	sneezy(times);
	cout <<times<<endl;
	return 0;
}



 

posted @ 2013-04-23 19:57  坚固66  阅读(133)  评论(0编辑  收藏  举报