Original Post
Hi... I''ve a question:
if I''ve these methods of a XXX class:
void SetBoolLink (bool link) { m_bBoolLink = new bool; *m_bBoolLink = link;}
and
void SwitchBoolLink () { if (*m_bBoolLink==true) (*m_bBoolLink)=false; else (*m_bBoolLink)=true;}
and I do this:
bool aBoolVariable = false;
xxxobject->SetBoolLink(&aBoolVariable);
xxxobject->SwitchBoolLink() ;
should aBoolVariable to be TRUE?
In my opinion yes, but for my program no...
after above code, *m_bBoolLink is TRUE but aBoolVariable is FALSE.
Why? If *m_bBoolLink is a pointer to aBoolVariable, then *m_bBoolLink=true is as aBoolVariable=true... or no?
thanks....
bye bye