Array size limits

后端 未结 5 589
北海茫月
北海茫月 2021-01-12 17:41

I have an array problem that i want to overcome, if i change the value of const int \"are\" to 2048 the program runs fine but at 8192 or even at 4096 ( just 130,000 elements

5条回答
  •  孤城傲影
    2021-01-12 17:58

    Allocate the array dynamically, since there are often limits on how much data you can have on the stack (which is where automatic local variables typically end up):

    unsigned char* cmain = new unsigned char[are];
    

提交回复
热议问题