调用回调函数出现has triggered a breakpoint,求教如何解决
答案:2 悬赏:70 手机版
解决时间 2021-12-25 11:47
- 提问者网友:佞臣
- 2021-12-24 23:58
调用回调函数出现has triggered a breakpoint,求教如何解决
最佳答案
- 五星知识达人网友:山君与见山
- 2021-12-25 01:21
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); }
这个问题一般发生在程序运行过程中。
下面是错误发生显示的信息:
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); }
全部回答
- 1楼网友:时间的尘埃
- 2021-12-25 01:36
fgets和实际分配内存大小不一致,访问内存违例了,另外还有内存泄露
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯