Can you set the size of the call stack in c++? (vs2008)

前端 未结 4 2068
鱼传尺愫
鱼传尺愫 2021-01-23 07:32

I\'m working from an example piece of code that allocates a relatively large local array. (32768 to be precise) When I try the same I\'m getting behaviour that appears to be a s

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-23 08:02

    With the Microsoft compiler you can use /F to set the stack size, however it seems like you should just allocate the object on the heap. You should have a reason you're allocating this on the stack rather than the heap.

    Edit: This page gives a good cross-platform breakdown, though it may be dated.

提交回复
热议问题