摘要: #include using namespace std;int main(){ int number=5; void cubeByPoint(int *);//指针传参声明 void cubeByRefer(int &x); cubeByPoint(&number);//传地址过去 cout<<number<<endl; int num=7; cout<<"num adderss "<<&num<<endl; cubeByRefer(num);}void cubeByPoint(int* 阅读全文
posted @ 2013-10-06 19:07 cart55free99 阅读(146) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int main(){int a=7;int* ptr;ptr=&a;cout<<&a<<endl;//如果不用using namespace std; cout会不识别cout<<"ptr is "<<ptr<<endl;cout<<"&ptr is "<<&ptr<<endl;//ptr指针的地址cout<<"*&ptr is " 阅读全文
posted @ 2013-10-06 17:17 cart55free99 阅读(250) 评论(0) 推荐(0) 编辑