A set all dynamically allocated data to zero B return any dy
A.) set all dynamically allocated data to zero
B.) return any dynamically allocated memory to the system
C.) explicitly destroy all the objects of the class
D.) All of the above
| When a class uses dynamic memory allocation, the destructor of the class must _____.(Points : 4) |
Solution
Answer: C.) explicitly destroy all the objects of the class
When a class uses dynamic memory allocation, the destructor of the class must explicitly destroy all the objects of the class
Destructor uses delete keyword to explicitly destroy all the objects of the class when a class uses dynamic memory allocation.
If Simple class does not use dynamic memory allocation, i mean just initilized the class that class does not required destructor to destroy the class object because c++ will take care of it implicitly.
