Hi peeps,
I've been having the problem I'm about to describe for more than half a year now, and I still don't know what might be causing it. Hopefully you guys can help me out.
Okay, here goes. Using
delete []
in my code makes my programs crash every time. It compiles just fine without any errors or warnigns but when I execute it, I always get a message like this:
Debug Assertion failed
Program: C:\VISUAL C++\PROJECTS\DATORGT5\DATORGT5.EXE
File: dbgdel.cpp
Line: 47
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
Now, I know how to use delete and I don't think I'm doing anything wrong, so why doesn't
delete []
work for me??
Even something like this:
int main()
{
char *ptr;
ptr = new char[sizeof(char) * 100];
delete [] ptr;
return 1;
}
will lead to a crash 100% of the time. :confused: Please help me if you can. Thanks in advance.
Edited by - Red Ant on October 12, 2001 10:09:31 PM