C++ Practice Quiz 2025 – Complete Exam Prep Based on 'Thinking in C++

Question: 1 / 565

What does operator delete do first?

Releases memory

Calls the destructor

When using the operator delete, the first step it takes is to call the destructor of the object being deleted. This is important because the destructor is responsible for cleaning up any resources allocated by the object. Options A and D are incorrect because they refer to the actual action of freeing up memory and do not specify the order in which the operator delete function operates. Option C is also incorrect because it refers to the check for a null pointer, which happens after the destructor is called. Therefore, the most accurate answer is B as it mentions the initial and crucial step of calling the destructor.

Get further explanation with Examzify DeepDiveBeta

Checks if the pointer is null

Calls malloc function

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy