How to access a variable in an object from a member object's function
<p>Ok, I have a class:</p>

<pre><code>class class1
{
public:
     class2 object2;
     int a;
};
</code></pre>

<p>where:</p>

<pre><code>class class2
{
public:
    void function2();
};
</code></pre>

<p>Basically, I need function2 in object2 to be able to access "a." How would I go about doing this? Thanks.</p>
