1.

What is a delete operator?(a) Deallocates a block of memory(b) Deallocates whole program memory(c) Deallocates only primitive data memory(d) Deallocates all the data reserved for a classThis question was addressed to me in a job interview.This intriguing question comes from Delete Operator topic in portion Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

The correct answer is (a) Deallocates a block of memory

Explanation: The DELETE OPERATOR is the REVERSE process of a NEW operator. It deallocates all the memory ALLOCATED for an object. The object can be of any type. The delete operator completely destroys an object so that the resources can be used for other purposes.



Discussion

No Comment Found

Related InterviewSolutions