Stack overflow visual C++, potentially array size?

后端 未结 2 1081
失恋的感觉
失恋的感觉 2020-12-12 05:24

As far as I know, this isn\'t caused by an infinite recursion.

The program functioned correctly with smaller arrays (it is an audio editor). Now I have increased fun

2条回答
  •  既然无缘
    2020-12-12 06:11

    As Vlad pointed out, don't allocate 50MB on the stack.

    But, the point is moot because you don't need to allocate any data. Try replacing your entire code fragment with a single call to std::reverse:

    std::reverse(&sound_data[0], &sound_data[track_samples]);
    


    Postscript: Don't forget to #include .

提交回复
热议问题