C++ · Structs and classes

Constructors, destructors and scope

An object can clean up after itself when it ends, and knowing when that happens tells you when its memory or file is let go.