Please enable JavaScript to use CodeHS

Data Structures in C++

Lesson 7.1 Pointers

Description

In this lesson, students learn about pointers, a variable that holds a memory address. Pointers are one of the key concepts in learning programming and are used for implementing several data structures.


Objective

Students will be able to:

  • Declare a variable as a pointer using the dereference operator (*)
  • Assign a pointer to an existing memory address using the reference operator (&) and a new memory address using the new keyword
  • Declare and initialize pointers that point to data structures
  • Declare and initialize data structures that store pointers
  • Declare and call functions that take a pointer type as a parameter
  • Use the arrow operator (->) to methods through a pointer in lieu of using the dot operator (.)