A class constructor is a function that places data into a class object and performs any other set up for a class object that needs to be performed when a class object is first instantiated. In this article, I’ll demonstrate how to create and use several different types of class constructors. I’m going to demonstrate how to create and use constructors using a class definition I developed in my previous article, which was an introduction to C++ classes.
One of the most difficult concepts for beginning C++ programmers to understand is the difference between passing function parameters by value and passing function parameters by reference.
Variable scope refers to the ability of a variable to be “seen” in a program. A variable is seen if, in a specific place in a program, the programmer has access to that variable’s value.
The typical way to perform selection (or branching) in C++ is with the if statement. In this article I’m going to demonstrate several ways to replace complex if statements with tables.