Delete operator _________________ A. Can be used on pointers

delete-operator-a-can-be-used-on-pointers

Delete operator _________________

A. Can be used on pointers with null value

B. Can be used on pointers with void value

C. Can be used on pointer with value 0

D. Can be used on pointer with any value

This question was addressed to me in a job interview.

My query is from Delete Operator topic in division Memory Allocation & Scope of Variable of Object Oriented Programming

The correct option is C. Can be used on pointer with value 0

To explain: The delete operator can be used on pointers with the value 0. This actually means that when new operator fails and return value 0 then deleting the result of failed new remains harmless. Hence the deletion is possible.