describe the important of Destructor
Answers
Answered by
1
Answer:
When an object is created the constructor comes into play and it takes care of automatic initialisations and other proceses. The constructor is called by the complier at the time of object creation.
Since it is important to destruct an object at the time its scope ends, we use a destructor.
The destructor destructs that is it releives the allocated memory for the object as soon as it is no longer needed.
The constructor is automatically invoked by the compiler and any other tasks can also be performed it at the time of object destruction.
Similar questions