gpt4 book ai didi

c - 这可能是由于堆损坏,这表明 cvector.exe 或它加载的任何 DLL 中存在错误

转载 作者:太空宇宙 更新时间:2023-11-04 01:15:08 24 4
gpt4 key购买 nike

我在测试程序中犯了很多错误!!!

调试源:http://www.cppblog.com/Files/mymsdn/cvector-windows-has-triggered-a-breakpoint-in-cvector.zip

正确的版本:http://www.cppblog.com/Files/mymsdn/cvector-svn-version-10.zip

我正在尝试编写 vector 结构的 C 语言版本。

如果我尝试运行(在 Microsoft Visual Studio 2008 中,默认快捷方式是 CTRL+F5)我的代码。可以作为正确的逻辑执行,输出正确的结果。

但是如果我尝试在 Debug模式下运行它(在 Microsoft Visual Studio 2008 中,默认快捷键是 F5)。它会导致一个问题:(它来自输出窗口,并且还有一个警告框来报告它)

HEAP[cvector.exe]: HEAP: Free Heap block 393168 modified at 393190 after it was freed Windows has triggered a breakpoint in cvector.exe.

This may be due to a corruption of the heap, which indicates a bug in cvector.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while cvector.exe has focus.

The output window may have more diagnostic information.

error
(来源:cppblog.com)

最佳答案

这个错误意味着你已经写入了一个你实际上并不“拥有”的内存地址——例如,你在它被释放后写入内存,或者在你实际分配的区域之外写入 newmalloc,或通过一个完全错误的指针。

关于c - 这可能是由于堆损坏,这表明 cvector.exe 或它加载的任何 DLL 中存在错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3226937/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com