Explain what happens when a pointer is deleted twice?
Answer / Mohammad Asad
Deleting a pointer twice causes undefined behavior in C++. The first deletion frees the memory allocated to the object that the pointer points to. When the same pointer is deleted again, the program may crash or exhibit unpredictable behavior.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the best c c++ compiler for windows?
What are iterators in c++?
What are all predefined data types in c++?
why the size of an empty class is 1
What are guid?
Why do we use templates?
What will happen if a pointer is deleted twice?
How would you implement a substr() function that extracts a sub string from a given string?
Explain what are mutator methods in c++?
In how many ways we can initialize an int variable in C++?
What is a class template?
Explain what you mean by a pointer.