65,210
社区成员
发帖
与我相关
我的任务
分享
char *q[2048];
for(int i=0; i<2048; i++) // 2G
{
q[i] = new char[1024*1024];//1M
}
for(i=0; i<2048;i++)
{
memset(q[i],10, 1024*1024);
}
int main()
{
char* p= new char[1024*1024*1024];
if(p==NULL)
{
std::cout << "malloc failed" << std::endl;
}
delete p;
return 0;
}
没全看懂,但是也明白了点!