I have two classes A and B. The control is inside one of the member functions of class A. The member function calculates the result, and now I want to send this value to one of the member functions of class B, I tried as follows, but it doesn’t works
int memberFunctionOfA ()
{
... // results are stored in some temporary value, say temp
B :: memberFunctionOfB (temp); // the way i tried
}
The compiler reported an error. I also tried how
B obj;
obj.memberFunctionOfB (temp);
Both gave me errors that cannot be caused by memberFunctionOfB. Can someone tell me what I am missing
Edit
Class B is not inherited from A. Both are independent. Both member functions are public and non-static.