NOTE:
These are a little sketchy...I'll fill in details 'soon'.
pointer variable +----+ +---+ | | | ----------------------------------->| | +---+ | | +----+
a pointer is a variable which stores the address of another variable
pointers allow indirect access to memory locations
this allows us to pass the address of an entire object/array rather than having to make a copy of the whole thing (which would be time/memory intensive)
a pointer variable is declared by placing a * in front of the variable's name:
type var; // normal variable type *pvar; // pointer variable
programmers often precede pointer variable names with a p to easily remember that it is a pointer variable
you can find out the memory address of an existing object using the unary & operator:
object // evaluates to the object itself &object // evaluates to the address at which the object is stored
you can access the value of the object of which a pointer holds the address by using the 'dereference' operator — unary *:
p // evaluates to the address of p's destination object *p // evaluates to p's destination object itself