C++ Constructors

Let’s look a little closer at constructors than we did in our initial Defining Classes for Objects example. Anytime you create an object, a constructor is called. If you overload your constructor, C++ will pick the right constructor to call, just like it does when you overload a function. Constructors must have the same name…

Creating an Object

Once you create your class, you need to create an object. The Class is just a blueprint for the program to follow. It doesn’t do anything until you create an object based off of that blueprint. Think of a house. If you have a house blueprint, all you have are some sheets of paper or…

Tower of Hanoi

The Tower of Hanoi, sometimes called the Tower of Brahma puzzle, is one of the classic problems to look at if you want to learn recursion. It is good to understand how recursive solutions are arrived at and how parameters for this recursion are implemented. The basics of the problem is that you have a…

Sitewide Links

The most common form of linking will be to other pages within your website. These are often called internal site links, as they are part of your own website. When you link to another file, you need to specify the file name in the href attribute like is shown below. Notice that the only required…