Ace Your C++ Skills 2026 – Rock the ‘Thinking in C++’ Challenge!

Question: 1 / 565

What happens if you pass a void pointer to delete?

Destructor is called

Object is not correctly deleted

Memory leak occurs

If a void pointer is passed to delete, it will cause a memory leak because delete does not know how much memory to deallocate for the object it points to. This can lead to memory fragmentation and other issues, since the memory will not be reclaimed properly. Passing a void pointer to delete can also cause undefined behavior, as there is no valid object to be deleted.

Get further explanation with Examzify DeepDiveBeta

Constructor is called

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy