Creating an 2-dimensional array of a struct results in crash

后端 未结 4 1044
抹茶落季
抹茶落季 2021-01-07 01:14

I am trying to generate a two-dimensional array of a struct, but this results in the program not launching. The window freezes and the program quits after a few

4条回答
  •  忘掉有多难
    2021-01-07 01:31

    If I got your snippet right way, you're trying to create an array. Allocation of the array is stack-based, with more than 2 Mb size required. There may be a chance that your stack has less than that 2Mb available, thus the code crashes right at the moment you're entering the function.

    Try to allocate the same array dinamically.

提交回复
热议问题