Memory allocation error

This is a discussion on Memory allocation error within the C++ Programming forums, part of the General Programming Boards category; I don't know what to make of these two errors. One happens when I'm trying to create a new instance ...

Actually, looking at the call-stack, it may well be that the heap is corrupted by that point.

Perhaps it's when you are populating B that you are overwriting some buffer of some sort.

Edit: So what I'm trying to say is that both problems are caused by similar things - usually by writing past the end of some array.

Edit2: To show the whole stack in your application in gdb, use "bt" - saves you hitting "up" 11 times [yes, hitting enter will repeat the previous command, but still easier to just type one command and be done with it].