I am working on an application were there are three possible sizes for the data entered:
- small: 1000 elements
- medium= 5000 elements
- large= 500,000 elements
The problem is that I can't allocate the large array. It seems that a size larger than 5000 is not accepted.
I get a run time error when I do the following:
long size=1000;
char ch;
int arr[size];
ch=getch();
if(ch==..)
size=...;
Sizes of 1000 and 5000 seem to work fine, but how can I make an array of size 500k in this way?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…