0

我试图执行

std::system(char* 字符串)

从我的类方法中,但我收到有关堆损坏的错误。我的源代码如下所示(Codec.cpp):

bool Codec::encode(char* fileIn, char* fileOut, int packetSize) {

    // some irrelevant code here

    std:system("pause");  // <-- error: corruption of the heap!
    return true;
}

我也尝试执行

标准::系统(“暂停”)

直接从我的主文件(main.cpp),但这里调试器通过该行没有任何错误,它应该可以正常工作。我在 WIN32 平台上工作,VS 2010。

为什么我会收到此 HEAP CORRUPTION 错误?

4

0 回答 0