OBject access from different functions in VC++
- by sijith
Hi,
I have 3 function in my class B. These three function have to access member function of other class A.
I did this by creating object of class A in class B constructor and tried to access that object in functions of class B. But its showing error.
How can i assess the same object in these three functions. Where i have to create object of class A
B::B()
{
A a;
}
B:: function()
{
a.fun(); //fun belongs to class A
}
B:: function1()
{
a.fun1(); //fun1 belongs to class A
}
I am getting error, How can i implement the same where i can access object a in both function.