1.

Operator used to free the memory when memory is allocated?(a) new(b) free(c) delete(d) none of the mentionedThis question was addressed to me at a job interview.This intriguing question originated from Destructors in Class topic in division Classes of C#

Answer»

Right option is (c) DELETE

Easiest EXPLANATION - ‘New’ is USED to allocate memory in the constructors. HENCE, we should use ‘delete’ to free that memory.



Discussion

No Comment Found

Related InterviewSolutions