Which operator should normally be used to release memory allocated using new in C++?

Options

  • A. free
  • B. remove
  • C. delete
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. delete

Detailed Explanation

Answer: delete

Memory allocated for a single object using new should normally be released using delete.

Example:

int *p = new int;
delete p;

Using the matching allocation and deallocation mechanism is important for correct memory management.