Debug assertion failed

后端 未结 3 1123
孤城傲影
孤城傲影 2021-01-20 20:05

I keep encountering this \"Debug assertions failed!\" error when I run my program in debug mode. I tried looking this error up on the visual C++ website but the

3条回答
  •  野性不改
    2021-01-20 20:49

    Your code is corrupting the heap. The first snippet is from the C runtime library, the assert is telling you that your program is passing a bad pointer value to the delete operator.

    Commenting out the delete statements merely hides the problem. It will come back to haunt you a different way when you keep developing the program. There are some debugging tips in this thread. Learning how to catch these kind of bugs is a rite of passage for any C or C++ programmer. Welcome to the group.

提交回复
热议问题