accessing variable that belongs to aother class
Hello
I have a member variable in the class CSpanaView,called ZoomIndicator. I want to access that variable in aother class CFastZoom. Below is the code by me to do above task
CFastZoom::OnCancel()
{
CSpanaView *ptSpana;
ptSpana->ZoomIndicator=FALSE;
}
but there is a memory exception when i run the code above
ZoomIndicator is a bool
Please help me!Thank You!
Re: accessing variable that belongs to aother class
CFastZoom::OnCancel()
{
CSpanaView *ptSpana;
ptSpana->ZoomIndicator=FALSE;
}
You cannot access a private member variable in CSpanaView class like this.
You can access ZoonIndicator through the member functions of CSpanaView if it is a private member variable.