1.

If delete is used to delete an object which was not allocated using new _______________(a) Then out of memory error arises(b) Then unreachable code error arises(c) Then unpredictable errors may arise(d) Then undefined variable error arisesThe question was posed to me by my college director while I was bunking the class.The query is from Delete Operator in portion Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

The correct answer is (c) Then unpredictable ERRORS may arise

Explanation: When the DELETE OPERATOR is used with the objects that were not ALLOCATED USING new operator then unpredictable errors may arise. This is because the delete can’t perform the required actions on the type of memory allocated for the object.



Discussion

No Comment Found

Related InterviewSolutions