B
Bob Smith
Dan said:How can I let two classes call a method from each other,
like in this example?
class A {
B* myB;
void doSomething() {
myB->doSomething();
}
};
class B {
A* myA;
void doSomething() {
myA->doSomething();
}
};
Thanks,
Dan
class A{
B * m_b;
public:
A( B * b ):m_b( b ){};
void b_do(){
m_b->doSomething();
}
void doSomething(){};
};
class B{
A * m_a;
public:
B( A * a ):m_a( a ){};
a_do(){
m_a->doSomething();
}
void doSomething(){};
}