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 answers

in 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

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -