如何分配到100M内存
66766 2005-02-17 12:54:28 // 22.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "stdio.h"
#include "stdlib.h"
#define one 80000
//把上面的数字改大就会出现运行错误,为什么我只能分配到10M内存
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
char * s1[one];
for(int ss1=0;ss1<one;ss1++){
s1[ss1]=(char *)malloc(40);
if(s1[ss1]==NULL) exit(1);}
char * d1[one];
for(int dd1=0;dd1<one;dd1++){
d1[dd1]=(char *)malloc(80);
if(d1[dd1]==NULL) exit(1);}
int * n1[one];
for(int nn1=0;nn1<one;nn1++){
n1[nn1]=(int *)malloc(sizeof( int));
if(n1[nn1]==NULL) exit(1);}
return 0;
}