Using extremely large arrays

Suppose I want to make a matrix like
double m[200][300];

How do I prevent the program from crashing?
That isn't that big, but it might be that you don't have enough stack space to put it there,
so might have to dynamically allocate it. There are plenty examples of how to dynamically
allocate 2D arrays around here.
I think dynamic allocation is only useful if the size of the matrix is changed. I just want to keep it as is and don't have enough memory to begin with.
It's also useful in cases like this, where the stack isn't large enough to hold the amount of memory you want. The heap has more space so try dynamically allocating it even if you don't intend to change it.
i tried making a table like:

double TestArray[1200][1000][5];

and it worked fine... (size was just like 45 million bytes... >.>)
i tried making a table like:

double TestArray[1200][1000][5];

and it worked fine... (size was just like 45 million bytes... >.>)
Topic archived. No new replies allowed.