我的程序在第二次运行时崩溃了:
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),但它没有帮助
任何有此问题的人?
答案 0 :(得分:2)
http://blogs.msdn.com/b/jiangyue/archive/2010/03/16/windows-heap-overrun-monitoring.aspx
听起来你早先在代码中运行了数组的末尾,并且你的内存管理人员在你尝试malloc那个内存空间之前不会把它拿起来。
答案 1 :(得分:1)
发现问题,它是由不同的realloc引起的。谢谢大家!