Using const with Pointers in C++

Similar Posts

  • Pointer Basics in C++

    A Pointer variable, just called a pointer, holds the memory address of data that is stored. Through the pointer, you can read the address, and thus indirectly access the value of the variable. To access a value, you use the dereference operators (*) to get the value stored at that memory address. To store a…

  • Defining New Datatypes

    OK, defining a new Datatype might be a bit of a stretch…how about, defining aliases? You can use the typedef keyword to define a new aliase for an existing data type in C++. The general form is: Let’s say you have experience with another language and you want to use a datatype name that they…

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

  • A Simple C++ Program

    Let’s walk through the steps to create a simple C++ program that will calculate a circle’s area using the formula area = pi x r2 First we’ll set up our preprocessor directives, and an empty main function. Next we will need to define variables that will be used by the program. In C/C++ we must…