Q:

Passing Pointer as parameter

Apologies if this question has been answered elsewhere, I wasn't sure exactly how to word a search for this.
My question is if I pass a pointer to a function, does that function get a copy of the pointer or the actual pointer that was passed?
in other words, if I have
printNext(myClass* foo)
{
    foo = foo->next;
    cout << foo;
}

will foo be changed permanently or just temporarily in the scope of the function?
if it is changed permanently, how do I make it not do that?
should I use printNext(myClass*& foo) ?

A:

You are sending a copy of the pointer to printNext.  Any changes to the parameter will change the copy and not the original.
If you want to change the pointer, either pass by reference or pass a pointer to the pointer.  

