Using const with Pointers in C++

Similar Posts

  • C-Strings in C++

    A C String is actually an array of characters. While C strings are a thing, generally speaking it is best to use the C++ string object. However, if you run into an older application, or someone who wants to do things old style, it is good to know how to use a C-String. Additionally, any…

  • For Loops in C++

    The for loop is the counting loop of C++. It is usually designed to run a specific number of times, and then end. With it, it keeps a counter, to let you know where in the loop you are – useful when looping through an array which will look at soon enough. The general form…

  • An Introduction to C++

    A little bit of history C++ is an expansion of the C programming language. It’s main addition was the ability to create and use objects. That makes it an Object Oriented Programming (OOP) based language. You do not have to start with objects however, as it retains all of the C procedural language constructs and…

  • 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…

  • The C++ While Loop

    A while loop says to perform a set of operations while a condition is true. It is known as a pre-test loop, because the condition is tested before the loop is run at all, meaning the body of the loop may never run. The general form for a while loop is: Notice that the loop…