Would someone explain the below code?
A{}
C{public: begin(&a); private: A *a;}
begin(&a)
{
a = &a;
}
B{private: A *a; C *c; start(); }
start(){
c->begin(&a);
}
=> In B, the object A is created and in C the object A is referenced to the object a in B.
then I got this problem:
no matching function for call to: begin(a**), candidate: begin(&a)
Otherwise, I can write this in C# and I am not sure how to implement this in C++:
public class A
{
public A(){}
}
public class B
{
A a;
C c;
public B()
{
c = new C();
}
void start()
{
a = new A();
c.begin(a);
}
}
public class C
{
A a;
public C(){}
public void begin(A a)
{
this.a = a;
}
}
Are you just trying to get the syntax correct?