const int L=10;
std::complex<double> c_array[L][L][L][L][L][L] // 6 dimensions
Space needed: 2*8*10^6 bytes
It should not use up all of memory, right?
There is a stack size limit for every processes. Therefore, if you really want to create this array locally (in the stack), the only solution is to increase the stack size limit for your program. How to change the stack size limit depends on your OS.
Alternative is to create this array in the heap. To do that you have to use "new" keyword as follows.
std::complex<double> *c_array = new std::complex<double>[L][L][L][L][L][L];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With