//1.求一个数组每个值的地址
include[HTML_REMOVED]
using namespace std;
int main()
{ int a[5]={0,1,2,3,4};
for(int i=0;i<5;i++)
{
cout<<(void*)&a[i]<<endl;
}
return 0;
}
2.两个地址做计算不会输出地址
include[HTML_REMOVED]
using namespace std;
int main()
{ int a[5]={0,1,2,3,4};
int p =&a[0];
int b =&a[1];
cout<<p<<” “<<b<<endl;
cout<<p-b<<endl;
return 0;
}
3.c++有 c语言没有的操作 & 引用
include[HTML_REMOVED]
using namespace std;
int main()
{ int a=1;
//intp =[HTML_REMOVED]
//p=3;
int& p =a;
p=3;
cout<<a;
return 0;
}