且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

堆栈溢出 Visual C++,可能是数组大小?

更新时间:2023-11-10 13:40:52

正如 Vlad 指出,不要分配堆栈上有 50MB.

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

但是,这一点没有实际意义,因为您不需要分配任何数据.尝试使用对 std::reverse的单个调用替换整个代码片段代码>:

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]);


附言:不要忘记#include .