Original Post
It seems like i do not fully understand how pointers works. I would be very thankfull if someone would explain to me what i am missing. { ---> Okay NodeReceiver here is the pointer that i am interested in. ---> When i send it to the function checkForNodeEdgeAt, i was expecting ---> the value it received in there to remain when it got out of the function. CNode *NodeReceiver = NULL; int iEdgeNrReceived = 0; ---> Call to function that changes NodeReceiver CNodeMgr::getSingleton().checkForNodeEdgeAt( miMouseX , miMouseY , NodeReceiver , iEdgeNrReceived); } ---> The function that is beeing called void CNodeMgr::checkForNodeEdgeAt(int iXPos, int iYPos, CNode* NodeReceiver, int &iEdgeNrReceiver) { map<unsigned int,CNode*> ::iterator next = mNodes.begin(); while(next != mNodes.end()) { iEdgeNrReceiver = next->second->checkForNodeEdgeAt(iXPos, iYPos); if(iEdgeNrReceiver != -1) { NodeReceiver = next->second ---> Using the debugger and stepping trough the code ---> i can see that the NodeReceiver now looks like this: ---> "+ NodeReceiver 0x003d5d30 {miNodeID=3 miX=300 miY=400 ...} CNode *" break; } next++; } } Once it gets back to the calling function, it reverts to: + NodeReceiver 0x00000000 {miNodeID=??? miX=??? miY=??? ...} CNode * How come?