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) ?