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
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.