侧对内存的问题
#include<iostream.h>
void main()
{long *array[10000];
long i=0;
long sum=0;
array[i]=new long [100000];
while(array[i]!=NULL)
{sum+=sizeof(long)*100000;
i++;
array[i]=new long [100000];
cout<<sum<<"bytes"<<endl;
}
cout<<sum<<"bytes"<<endl;
delete []array[i];
cout<<endl;
}
为什么根据建立的不同数组大小,测出来的对内存的值不同啊