title: calling a member function of different class from another class
body: <p>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</p>
  
  <pre>
  int memberFunctionOfA()
  {
  ... //results are stored in some temporary value, say temp
  
  B::memberFunctionOfB(temp);  // the way i tried
  }
  </pre>
  
  <p>The comiler reported an error. I also tried like</p>
  
  <pre>
  B obj;
  obj.memberFunctionOfB(temp);
  </pre>
  
  <p>Both gave me errors that the memberFunctionOfB cannot be called. Can anyone tell me what am i missing</p>
  
  <p><b>Edit</b></p>
  
  <p>Class B is not inherited from A. They both are independent. Both the member functions are public and non static</p>