看代码
const int N=10;
map<int,vector<int>**>v;
map<int,int**>e;
signed main(){
int x,y;
x=1,y=2;
if(!e.count(0)){
e[0]=new int*[N];
if(e[0][x]==NULL) (e[0][x])=new int[N];
e[0][x][y]=y;
cout<<e[0][x][y]<<' '<<typeid(e[0][x][y]).name()<<endl;
}
if(!v.count(0)){
v[0]=new vector<int>*[N];
if(v[0][x]==NULL) (v[0][x])=new vector<int>[N];
cout<<typeid(v[0][x][y]).name()<<endl;
v[0][x][y].push_back(y);
}
return(0-0);
}
用 int 类型访问不会RE,但 vector 会,但是输出变量类型是正常的。
求大佬告知,会不会是动态开内存的关系,有没有解决方法(