Is there any limit on stack memory?

前端 未结 6 2038
清酒与你
清酒与你 2020-12-16 20:06

I was going through one of the threads. A program crashed because it had declared an array of 10^6 locally inside a function.

Reason being given was memory allocatio

6条回答
  •  别那么骄傲
    2020-12-16 20:33

    This all depends on what language and compiler you use. But programs compiled with for instance C or C++ allocate a fixed size stack at program startup. The size of the stack can usually be specified at compile time (on my particular compiler it default to 1 MB).

提交回复
热议问题