Beginner C++
Q30 / 100

What does the delete operator do?

Correct! Well done.

Incorrect.

The correct answer is B) Frees heap memory allocated with new and calls the destructor

B

Correct Answer

Frees heap memory allocated with new and calls the destructor

Explanation

delete ptr; calls the destructor and frees the memory. delete[] arr; must be used for arrays allocated with new[].

Progress
30/100