Hai
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?
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
}
What is wrong in the above code?.
ERROR:
note: synthesized method first required here error: initializing argument 1 of ‘void A::fun(B,C)’
Thank you
classdeclarations need to be followed by a;, functions must have a return type (e.g.intfor main) etc.;can choke the compiler and make it misinterpret the rest)