I need some pointers on pointers (chuckle)
I have an object declared on the free store:
Obj *myObj = new Obj;
if i passed this pointer to a function like:
blah(Obj *pointer);
would this create a new instace of myObj on the free store? Or would it just create another pointer that points to it? If so, would those to pointers be identical in that they both pointed to the same spot in memory?


Also, I would like to store a pointer to this object in another class, and i was wondering what the syntax would be: I've been trying, but i've been getting so many errors i can't make heads or tails of it. This is waht i've done:
class Obj2 {
public:
void setPointer(Obj *&pObj);
private:
Obj *pointer;
};

void Obj2::setPointer(Obj *&pObj) {
(*pointer) = pObj;
}

Obj2 *myObj2 = new Obj2;
myObj2->setPointer(myObj);

Would this create a direct pointer to myObj in Obj2? Or would it create a pointer to the pointer of myObj? What i basically want is just a pointer in myObj2 that is a copy of the pointer to the object myObj. I hope this makes sense.
thanks