Question OOP-CTOR-0022
EasyIn C++, when is the destructor of a local object called?
- A.
Only when delete is used on it
- B.
When the program starts
- C.
Show answer and explanation
Answer: D
Leaving the block where it was declared destroys a local object automatically.