1.

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 valueThis 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

Answer»

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.



Discussion

No Comment Found

Related InterviewSolutions