How to check memory corruption in C ++

I have a problem in my project. Sometimes execution is interrupted with the error "unabe to access the read / write location xxxxx". I know this is a memory error. But how can I track this error. It fails to free the variable memory if I comment on this line that it processes. That is, the memory for this variable has already been released. It used to work fine, I added the code recently, but I haven’t changed anything related to this. How can I check for memory corruption for this.

+5
source share
3 answers

Use valgrind if you are on Linux, it will show you what happens if you stomp in your memory.

: . .

+7

, ( ), , . memcopy - , , , .

, () .

0

If you use windows, try winDbg. Its the best and very powerful.

0
source

All Articles