structure classes

hello!
I have two component classes, classA defined before classB,
and I need to call from classA a method in classB (update component coordinates)
classC hold instances of classA and classB, and is defined after those two,
everything start running from classC
i dont know how to deliver access between the classes, they are seperated because
they do different things and otherwise inside one class, they can share resources but, it would be a mess, what if I have more component classes ? mess

what are my options on this?

thanks!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class A {
  void foo();
};
// class A has been defined

class B {
public:
  void bar();
};
// class B has been defined

// implementation. B is known.
void A::foo() {
  B gaz;
  gaz.bar();
}
thanks, I was implementing inside classA where B is unkown I guess, problem solved.
its perfectly doable to add a B gaz; inside class A and call .bar inside one of A's methods.
If you need to do that still?
Topic archived. No new replies allowed.