C Program crashing with large arrays

前端 未结 4 825
难免孤独
难免孤独 2021-01-17 08:15

I\'m trying to run a simulation that involves a large amount of calculations and values.

I\'ve got an issue in that large arrays cause the program to crash before it

4条回答
  •  温柔的废话
    2021-01-17 08:29

    2*4*5*10001 = 400,040 elements. Double means 8 bytes per element. And 400,040 * 8 = 3,200,320 bytes

    3,200,320 bytes size is beyond the stack memory size to handle.

提交回复
热议问题