Overview

Why use pointers?

What's a pointer?

Declaring pointers

Initializing/Setting pointers

Pointer operators

Pointer arithmetic

Pointers as parameters

Pointers vs. arrays

Array of pointers

Function pointers

 


Arrays of pointers

  • creates array of strings
  • each entry in an array is a string
char *suit[4] = {"spades", "clubs", "diamonds", "hearts"}; 

cout << suit[1]      // output: clubs 
     << *suit[1];    // output: c