摘要:
#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* 阅读全文
摘要:
#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 " 阅读全文