C++引用指针数组
#include<iostream>#include<vector>
#include<string>
using namespace std;
int main(void){
int i=1;
int j=2;
int k=3;
int *ptr={
&i,&j,&k
};
cout<<*ptr<<endl;
cout<<*ptr<<endl;
cout<<*ptr<<endl;
int *(&array)=ptr;
cout<<*array<<endl;
cout<<*array<<endl;
cout<<*array<<endl;
return 0;
}
文档来源:51CTO技术博客https://blog.51cto.com/u_15302296/3072263
页:
[1]