15.1 — The hidden “this” pointer and member function chaining

One of the questions about classes that new programmers often ask is, “When a member function is called, how does C++ keep track of which object it was called on?”. First, let’s define a simple class to work with. This class encapsulates an integer value, and provides some access functions …

19.3 — Destructors

A destructor is another special kind of class member function that is executed when an object of that class is destroyed. Whereas constructors are designed to initialize a class, destructors are designed to help clean up. When an object goes out of scope normally, or a dynamically allocated object is …