Copy Constructors

We’ve talked about Constructors in C++ already. One of the special methods, along with Destructors, that C++ offers. There is a third, special method which C++ offers. That is called a Copy Constructor. The Copy Constructor is a special type of constructor, which is intended for use when you duplicate an object. Some people will…

Destructors in C++

We’ve looked at Constructors in C++ to create an object, and building an object with new. However, what happens when we no longer need that object? That’s where a destructor is called. It is built into all objects, and if you don’t define one, a default one will be called for you. The destructor’s job…