title: Access parent object variables from child object
body: <p>I’m designing a user interface in C++. I have a class called UI which is the parent of the UI. My program has single instance of the UI class which contains UI wide data like colors and fonts etc. as well as all of the control objects. This object also has a render function which renders the entire UI by calling the render functions of every child object. The render functions of the child objects need colors and fonts to render the controls.</p>
  
  <p>So my question is how can a child object access the color and font variables of the parent object?</p>