Access parent properties/methods?

  • Thread starter Thread starter Chris Ashley
  • Start date Start date
C

Chris Ashley

Say I have a class called TabManager, which has an array of Tab
objects? There is no inheritance or other relationship between them
apart from the TabManager instantiating the tab objects and holding
them in an array. How can the Tab objects call the methods and access
the properties of its TabManager parent? Can I pass a pointer from the
TabManager to the Tab object in its constructor somehow?
 
Hi,


Chris Ashley said:
Can I pass a pointer from the TabManager to the Tab object in its
constructor somehow?

Yes, that is how you do it, you need to pass a reference to the container


cheers,
 
Back
Top