In this lesson, we examine the data types that C++ provides for storing addresses of data.
These are important because they
It’s rather like answering a question about, say, the meaning of the word “Ragnarok” by pointing to a nearby dictionary instead of explaining it directly.
In our code, sometimes we will employ this indirection for efficiency. In other cases we use it for flexibility or to simplify our code.
A pointer or reference is the "name" or "address" of an object NOT the object itself.
Most variables have names assigned to them by the programmer at the time the program is written (e.g. "int numberOfCourses;"). Every variable in a program has an machine address where that variable is stored in the main memory of the computer. Think of this as the "machine’s name" for the variable.
Every variable in a program has a value which is the data stored in the variable’s address.