Misunderstanding something about pointers?
thankfull if someone would explain to me what i am missing.
Highlighting the pointer with red to make it clearer what i talk about.
{
> 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;
> 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<
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 *"
}
next++;
}
}
Once it gets back to the calling function, it reverts to:
+ NodeReceiver 0x00000000 {miNodeID=? miX=? miY=? ...} CNode *
How come?

