Share member between two objects
<p>I have two classes, A and B like this :</p>

<pre><code>class A
{
public:
    A(int i)
    {
        this-&gt;i = i;
    }
private:
    int i;
};

class B
{
public:
    B()
    {
        i = 0;
        a = new A(i);
        i++;
        // i = 1
        // a-&gt;i must be 1
    }

private:
    A* a;
    int i;
};
</code></pre>

<p>I tri to share a member between the two objects.
I want when i is modified in B, i have to be modified in A.
How can I doing something like that ? It is possible by reference ?
I hope I was clear.
Thanks.</p>
