Balanced Binary Search Tree w/Doubly Linked Lists

I am getting an assertion failure with my binary search tree.

1
2
3
4
5
6
7
8
9
Debug Assertion Failed!

Program: U:\Visual Studio 2010\Projects\C++ Headers\Debug\C++ Headers.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
Line: 52

Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.


Thanks ahead of time, especially if anyone is willing to go through my code :'(

I dont even know what the issue is or where it is, if its a problem with stack overflow etc, never run into an assertion problem before and it does not give a credible error line

https://docs.google.com/open?id=0B94sQ7a2ETgiV0J4NnRSUzhRNXlBUDhkUWE5M1h0dw
Header File

https://docs.google.com/open?id=0B94sQ7a2ETgiTHEwX2ltOGxRNlNXOTdoWnd1bjAwdw
Cpp File
Last edited on
Bump
bump again :(
this is a macro: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

Which might look like this beyond the macro.

assert(pHead->nBlockUse);

For a test to see if pHead->nBlockUse is valid.
like:
1
2
3
4
if(pHead->nBlockUse != someInt) // nBlockUse suggests that is a number of some form.
{
       // do something
}


this is why I don't like using macros, it makes code hard to follow if you can't find the definition of the macro.
I wasnt even using that, its in one of libraries in visual studio C++ that i didnt even include, but for some reason i get errors for it
if you include something like "windows.h" it will pull in a lot of libraries that you didn't use. Your links to your code aren't very useful and don't work. Does the error show up in your code or a release version?

And it asserts because something is invalid that was setup in a library somewhere, which is checking a block of memory is valid.

Topic archived. No new replies allowed.