I have two classes A and B. The control is inside one of the member functions of class A. The member function calculates a result and i now want to send this value to one of the member functions of class B, I tried the following way, yet it dint work
int memberFunctionOfA() { ... //results are stored in some temporary value, say temp B::memberFunctionOfB(temp); // the way i tried } The comiler reported an error. I also tried like
B obj; obj.memberFunctionOfB(temp);
Both gave me errors that the memberFunctionOfB cannot be called. Can anyone tell me what am i missing
Edit
Class B is not inherited from A. They both are independent. Both the member functions are public and non static
memberFunctionOfBis private/protected, but it's hard to say for sure without seeing the code.B obj(42, "These are sample args");rather than justB obj;. Look through the code for class B and find out what its constructor expects.B obj;