摘要: #include <iostream>using namespace std;void change(int *a,int &b,int c)//指针作形参,前面加*号,引用作形参前面加&号。{ c=*a; b=3; *a=2;}int main(){ int a=1,b=2,c=3; change(&a,b,c);//指针作实参,前面加取地址符&,引用作实参,前面不加符号 cout<< a<< b<< c<<endl; return 0;} 阅读全文
posted @ 2011-03-31 15:39 瓜蛋 阅读(723) 评论(0) 推荐(0)