What are Pointers?

This lesson introduces the concept of pointers in C++


A pointer is a special kind of variable that stores the address in memory of another variable and can be used to manipulate that variable.

In general, whenever a variable is used in C++, it must exist somewhere in the host computer’s memory and pointers can store the location of a particular variable.

What do Pointers Hold?

Pointers associate two pieces of information:

  • The memory address, which is the “value” of the pointer itself.
  • The data type of the variable pointed to, which is the kind of variable located at that address.

Dereferencing Pointers

Pointers can be dereferenced to access the value of the variable at the pointer’s address​.

For example:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy