In embedded systems, a driver often owns internal buffers that must exist only while the driver exists. When the driver shuts down, all owned resources must be released in a deterministic order.
Your task is to model this using composition and observe the construction and destruction order.
Do This:
Create a Buffer class that stores one integer
Create a Driver class that owns a Buffer
Read one integer from input
Store it in the buffer via the driver
Print the stored value
Observe destruction when the driver goes out of scope