#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(void){
int i=1;
int j=2;
int k=3;
int *ptr[3]={
&i,&j,&k
};
cout<<*ptr[0]<<endl;
cout<<*ptr[1]<<endl;
cout<<*ptr[2]<<endl;
int *(&array)[3]=ptr;
cout<<*array[0]<<endl;
cout<<*array[1]<<endl;
cout<<*array[2]<<endl;
return 0;
}
C++引用指针数组
最新推荐文章于 2023-03-09 16:09:00 发布