What happens when a pointer is deleted twice


Asked by admin @ in Computer Science viewed by 177 People


What happens when a pointer is deleted twice

Answered by admin @



Answer:

If you delete a pointer and set it to NULL, it it possibly cannot have an adverse effect. It is safe. However, if a pointer is deleted an not nullified  then it can cause a trap

Explanation:

I know that a "deleting the same memory twice" error can happen when two pointers address the same dynamically allocated object. If delete is applied to one of the pointers then the object's memory is returned to the free store. If we subsequently delete the second pointer then the free store may be corrupted.


Similar Questions

Overcoming fixed mindset: a step-by-step guide to cultivating a growth mindset

Asked by wiki @ in Health viewed by 1237 persons

Which of the following would best complete this list?

Asked by wiki @ in Social Studies viewed by 706 persons

What had the king decided to do before he saw the spider

Asked by vanshika149 @ in English viewed by 1099 persons

Describe the karez in your own words

Asked by rajesh064 @ in English viewed by 1255 persons

What is 8 + (x + 5)?

Asked by jaylord7 @ in Mathematics viewed by 1052 persons

What is the topic of the info grapher

Asked by jesus643 @ in History viewed by 1344 persons

Elephant kills 11 in nepal , woman rescued from a friendly dolphine

Asked by kavin044 @ in English viewed by 1220 persons

(-3,0);slope =2/3

Asked by timothy2 @ in Biology viewed by 1596 persons

Which is an example of situational irony in "wherefore art thou romeo?”

Asked by noah5213 @ in English viewed by 1527 persons

How to enhance knowledge regarding environmental factors through capsim?

Asked by wiki @ in Business viewed by 1699 persons

Most viewed questions in Computer Science


A programmer mistakenly writes gor instead of for

Asked by admin @ in Computer Science viewed by 19017 persons


Domestic data entry operator ncert book class 9 solutions

Asked by admin @ in Computer Science viewed by 15801 persons


Information technology code 402 class 9 solutions chapter 1

Asked by admin @ in Computer Science viewed by 10968 persons



Ncert solutions for class 8 computer chapter 1 computer system

Asked by admin @ in Computer Science viewed by 10399 persons


A scrum team works on a 4 weeks sprint

Asked by admin @ in Computer Science viewed by 8719 persons


Which of the following occupies more memory in c

Asked by admin @ in Computer Science viewed by 8133 persons



A database of motor vehicles has the base entity

Asked by admin @ in Computer Science viewed by 7839 persons


The network architecture can be termed as a mcq

Asked by admin @ in Computer Science viewed by 6482 persons


Cat5 and cat6 cabling refer to which reference model layer

Asked by admin @ in Computer Science viewed by 5786 persons



Class 7 computer chapter 3 questions and answers

Asked by admin @ in Computer Science viewed by 5687 persons


Choose the correct options about usability and user experience

Asked by admin @ in Computer Science viewed by 5472 persons


Which advocates daily team meetings for coordination and integration

Asked by admin @ in Computer Science viewed by 4979 persons



Which three security features match the database security level

Asked by admin @ in Computer Science viewed by 4969 persons


Which of the dbms package is not available

Asked by admin @ in Computer Science viewed by 4681 persons


________ aid a business grow and attain its objectives

Asked by admin @ in Computer Science viewed by 4485 persons