top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What happens when a pointer is deleted twice in C\C++?

+2 votes
722 views
What happens when a pointer is deleted twice in C\C++?
posted Feb 3, 2015 by Alwaz

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
This is already been discussed,
Please follow below link,
http://tech.queryhome.com/74389/can-a-pointer-be-freed-more-than-once-in-c

2 Answers

+1 vote

It is not certain and depends. If the value of the pointer is set to 0 soon after first delete, then not operation will perform. If not, there are chances for program crash.

answer Feb 4, 2015 by Mohammed Hussain
0 votes

This issue is known as double free.

answer Feb 5, 2015 by Vikram Singh
...