蒲公英110

调用回调函数出现或者大循环出现has triggered a breakpoint

triggered a breakpoint 的意思是触发一个断点。
这个问题一般发生在程序运行过程中。
下面是错误发生显示的信息:
Windows has triggered a breakpoint in xxx.exe.
This may be due to a corruption of the heap, which indicates a bug in xxx.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while t.exe has focus.
The output window may have more diagnostic information.
这个错误发生的两个原因:
1.用delete或是free删除不是堆栈上的变量。
比如:
int n = 88;
delete n;
2.使用了已经delete或是free后的变量。
比如:
char *str = (char *) malloc(100); strcpy(str, "hello"); free(str); if(str != NULL) { strcpy(str, "world"); printf(str); }

posted on 2016-11-11 16:30  蒲公英110  阅读(872)  评论(0编辑  收藏  举报

导航