delete operator - Deleting objects in c++; -
delete operator - Deleting objects in c++; -
this question has reply here:
calling delete on variable allocated on stack 11 answersin c have free memory has been allocated program. same go objects in c++?
class mutual { //some function declarations } void example() { mutual obj; //do stuff obj delete obj; }
how of import delete obj; here if asume function example() called 1 time only?
you have not delete
local object of function allocated on stack. have delete objects allocated using operator new
.
moreover, delete
operator applied pointers. code snippet not compile.
c++ delete-operator
Comments
Post a Comment