Reach methods...

My app has a main class (MainClass), which contains two objects,

1
2
3
4
5
6
7
class MainClass
{
[...]
Class1 m_object_1;
Class2 m_object_2;
[...]
};


In a method defined in my "m_object_2", another object is declared.

1
2
3
4
5
6
Class2::method1()
{
	[...]
	Class21 m_objet_21;
	[...]
}


which derives of Class20

class Class21 : public Class20 {}

My question is: How could I reach the public methods of m_object_1 from this Class20 (and its derived classes) ? What do you suggest ? using "friend" statements ? copying objects...?

S.
You can't, or rather you shouldn't. Can say in more real terms what the problem is and what you want to do.
Topic archived. No new replies allowed.