Skip to main content

Posts

Showing posts from August, 2018

Pointers

c++ Programming    Introducing Pointers In order to understand pointers we must first start with an understanding of how computers handle the data for you application.  When you declare a variable in your code, you are providing key pieces of information to the compiler for handling the data stored as a part of that variable.  The data type determines how much memory is requested for that variable.  Once the variable is declared, you don't need to worry about where in memory it is stored.  Simply referring to the variable name in code is sufficient for gaining access to the value stored there. But let's take this concept a little further and explore memory locations in your code.  Consider the following code:     int num = 3; This is a simple variable declaration of type int, called num, that stores the value 3.  The variable num actually references a location in the comp...