我的程序在此行的第二次运行时崩溃:
char* temp_directive = (char *)malloc(7);
出现此错误:
Critical error detected c0000374
Windows has triggered a breakpoint in Maman14.exe.
This may be due to a corruption of the heap, which indicates a bug in Maman14.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while Maman14.exe has focus.
我不明白为什么,它总是发生在第二次运行中。我尝试添加免费(temp_directive),但没有帮助
有人对这个问题有疑问吗?
> http://blogs.msdn.com/b/jiangyue/archive/2010/03/16/windows-heap-overrun-monitoring.aspx
听起来你在代码的前面跑掉了数组的末尾,并且在您尝试 malloc 内存空间之前,您的内存管理不会拾取它。
发现问题,它是由不同的 realloc 引起的。谢谢大家!