<分区>
代码1:
int * a;
a=new int[222];
cout<<"the size of a is "<<sizeof(a)<<endl;
输出1:
the size of a is 8
代码2:
int * a;
a=new int[222];
cout<<"the size of a is "<<a.length()<<endl;
输出2:
error: member reference base type 'int *' is not a structure or
union
如何获取堆数组的大小?谢谢..