Which operator is used to release memory allocated for a single object using new in C++?

Options

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

Correct Answer (Detailed Explanation is Below)

B. delete

Detailed Explanation

Correct Answer: Option B — delete

Explanation: Use delete for a single object allocated using new, such as int *p = new int; delete p;. Using the matching allocation and deallocation forms is important.