What is a pointer?
A pointer is a variable that stores the hexadecimal address of the variable it is pointing to.
A pointer variable is declared like so:
type* pntr; type *pntr;
Accessing Memory Address
A memory address of a variable is obtained using the reference operator (
A pointer is dereferenced using the dereference operator (
Incrementing and Decrementing Pointers
Pointers can be incremented and decremented using the
- arithmetic operators.
Arrays can be accessed by using a pointer to the first element and incrementing and decrementing as necessary.