Want to pass objects as a parameter in member function c++
<p>I have a class A,B,C now i have member function in class A which needs the objects of 
class B,C. Is it possible to achieve. If yes how?</p>

<pre><code>class A 
{
  public:

  void fun(B obj_b,C obj_c)
  {

   }

} 

class B 
{
  //some work
} 

class C
{
  //some work
}


int main()
{
  B obj_b;
  C  obj_c;
  A obj_a;

  obj_a.fun(obj_b,obj_c); //I GET ERROR HERE DURING COMPILATION  
}
</code></pre>

<p>What is wrong in the above code?.</p>

<p>ERROR:</p>

<p>note: synthesized method first required here 
error:   initializing argument 1 of ‘void A::fun(B,C)’</p>

<p>Thank you</p>
