Question: What is the purpose of a destructor?
- It allows the programmer to write the necessary code to free the resources acquired by the object prior to deleting the object itself.
- It deletes an object. One example of a destructor is the `delete()` function.
- It terminates a program. This may be achieved as a regular function call or as an exception.
- There are no destructors in C++.
Answer: The correct answer of the above question is Option A:It allows the programmer to write the necessary code to free the resources acquired by the object prior to deleting the object itself.