hi
how to destroy the object...created during the execution of program to handle memory managment..
thanks in advance
Printable View
hi
how to destroy the object...created during the execution of program to handle memory managment..
thanks in advance
using operator delete.
hi
can i have to use delete operator in destructor only or anywhere in the program code..
you can use delete anywhere, but only on objects created on heap (with operator new). And delete calls the destructor so you can use delete on other member variables (created on a heap) of that object to clean up.
P.S. There are a lot of C++ tutorials in the Internet so please take a look at them - you ask about C++ basics needed to start writing more advanced applications than "Hello World!"