Two Resource objects are allocated with new. Delete only a, then print done – leave b un-deleted,
deliberately, so its destructor’s silence is visible in the expected output.
Look closely at the expected output: Destroyed: beta never appears. That’s the actual point of this exercise,
not an oversight – b’s destructor genuinely never runs, because nothing ever calls delete on it. In a real
program this is exactly a memory leak, the C++ equivalent of forgetting free in Module 2, just with a
constructor/destructor pair making the consequence directly visible here instead of invisible. Every new still
needs exactly one matching delete, precisely as Module 2 required for every malloc and free – this exercise
just makes what “forgetting” costs impossible to miss.