2
I’m doing a test and it gives me an error when I try to create a vector[1000][1000]. There are limits to vectors?
The error code (application ceases to respond) is the following:
int main (){
int DIM_X = 1000;
int DIM_Y = 1000;
int vectorMD[DIM_X][DIM_Y];
int x,y;
for(x=0;x<DIM_X;x++){
for(y=0;y<DIM_Y;y++){
vectorMD[x][y] = x;
}
}
}
What mistake do you get?
– gato
The error would be the application no longer responding?
– Lucas Kauer
Good, Answering questions that put me above: 1. The Error is not compilation, it is in execution. 2. The error you give is when executed: a windows message appears "The application stopped responding". I had no idea there were limits but as I’m going over a bit of C but on a Windows machine, I was confused. Yes, I’m using Devc+++ but I also tested it in Code:Blocks. I also compiled and ran it on a Powershell console. All failed. Something I’m missing. Cumps
– pintasart
How much memory you have in the machine, and what else is lurking in it?
– jsbueno
Good, 8GB and was running nothing else.
– pintasart
@pintasart Have any of the answers solved your question? Do you think you can accept one of them? See the [tour] how to do this, if you haven’t already done so. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site (when you have enough score).
– Maniero