Actions

EmSys

Arrays and Pointers

From EdWiki

  Arrays & Pointers
EmSys:C - Pointers
Slide 1 of 15  
  

Pointers

A pointer is a variable that contains the address of an another variable.

int* ip;	// ip is a pointer to int
char* cp;	// cp is a pointer to char

The unary operator & gives the address of a variable.

char ch;
cp = &ch;

assigns the address of ch to the variable cp, and cp is said to “point to” ch.