标签:ext blog end pac bsp iss iostream cout main
#include <iostream> using namespace std; void fun1(int &x,int &y); void fun2(int *x,int *y); int main() { int a,b; a=11; b=22; fun2(&a,&b); cout<<"a="<<a<<" b="<<b<<endl; fun1(a,b); cout<<"a="<<a<<" b="<<b<<endl; return 0; } void fun1(int &x,int &y) { int t; t=x; x=y; y=t; } void fun2(int *x,int *y) { int *t; t=x; x=y; y=t; }
估计结果
a=11 b=22
a=22 b=11
实际结果
分部 。一步一步来就能得到正确结果( ⊙ o ⊙ )!
标签:ext blog end pac bsp iss iostream cout main
原文地址:http://www.cnblogs.com/cxchanpin/p/6842681.html