Pointers

A pointer is a variable which can contain a reference to another variable.

A pointer can be used to get the value in the other variable or change the value in the other variable.

Pointers are usually implemented with addresses.

The pointer variable contains the address in memory of the variable it refers to.

A pointer type is denoted by appended an '*' to the type of the variable refered to.

This declaration creates a variable ip which can refer to an int variable:

int *ip;

Note, you can have pointers to any type, not just primitive types.

Index