Recently, I work in C++ and I have to create a array[60.000][60.000]
. However, i cannot create this array because it\'s too large. I tried float **array
A matrix of size 60,000 x 60,000
has 3,600,000,000
elements.
You're using type float
so it becomes:
60,000 x 60,000 * 4 bytes = 14,400,000,000 bytes ~= 13.4 GB
Do you even have that much memory in your machine?
Note that the issue of stack vs heap doesn't even matter unless you have enough memory to begin with.
Here's a list of possible problems: