how to declare 10000 x 100000 sized integer matrix in C++
问题 I need to create a matrix which size is 10000x100000. My RAM is 4GB. It works till the 25th iteration (debug), but after 25th iteration I get an error "bad allocation" however only 25% of RAM is used which means the problem is not related with memory. So what can I do? EDIT: int **arr; arr=new int*[10000]; for(i=0;i<10000;i++) arr[i]=new int[100000]; My allocation is above. 回答1: If you're compiling for x64, you shouldn't have any problems. If you're compiling for x86 (most likely), you can