class CApplication
{
CMenu* m_pMenu;
IDirect3DDevice8* m_pD3DDev;
... //application specific stuff, (initialization, main loop...)
}
class CMenu
{
CApplication m_pParent;
... //menu specific stuff
}
The class CApplication creates an instance of the objects CMenu, and CMenu owns a pointer to the parent who created the object. CMenu needs to access member private and protected data in CApplication (the parent), and this could be accomplished by making CMenu a friend of CApplication. Would this be a good way of doing it, or should I do it using accessors and mutators?
Thanks
Real programmers don''t document, if it was hard to write it should be hard to understand