Monday, July 27, 2009

I have problems with dynamic mem. al. in C++. It's a row for you,but the end of a three-day affliction for me.

I do this in a part of my C++ program: int* pTemp=new int


[size()];


(size() is an unsigned int value, it shows the size of an array)





But when I run it, I get this message:





"heap corruption detected: after normal block (#115) at 0x003A5490. crt detected that the application wrote to memory after end of heap buffer."





and when I'm debugging it:





"there is no source code available for the current location."





What can I do?





Domonkos





(It's C++ in Microsoft Visual Studio 2005)

I have problems with dynamic mem. al. in C++. It's a row for you,but the end of a three-day affliction for me.
1) Could it be you're asking for too big of a size? Use smaller values until the problem stops, if it does.


2) Is the value negative?


3) If this problem doesn't go away, check to see if there is by some chance some file that has overridden the new operator. This is a very odd situation, but has been known to happen.





just a couple of suggestions.


No comments:

Post a Comment