https://www.clien.net/service/board/kin/4098266
I expect it to be different depending on the hardware and the compiler To write code that can be compiled in any environment, We need to declare the number of arrays at the right level and do dynamic assignments
This issue is a stack size issue, not a static array size issue.
Regional variables are stored using a space called stack, and under the limitation of visual c++, the default stack size is 1 megabyte.
int StaticDoubleArray1[2500][2500] = { 0 };
The size of the above regional variable is int (4byte assumption) * 2500 * 2500.
That's 2500 x 2500 x 4 = 250000 bytes, which is about 24 megabytes. Therefore, stack overflow occurs.
You can increase the stack size by referring to the link above.
© 2024 OneMinuteCode. All rights reserved.