Accessing "neighbor" classes created from 1 class possible?
<p>Here's my problem:</p>

<p>I have 1 class that creates two new instances of a two other classes, and now I would need to either have a direct availability from one of the instances to the other, is this possible and if so, how?</p>

<p>so:</p>

<p>in Class A:</p>

<pre><code>b = new B(5); // where 5 is an int data member of B
c = new C();
</code></pre>

<p>and let B::bee() be a function I would need to access from C() BUT, I would need to access members of B (not a new instance of B) created by A.</p>

<pre><code>So C::getIntfromB(){
  b-&gt;getInt();
}
</code></pre>

<p>Or something.</p>

<p>I've tried going for:</p>

<pre><code>b = new B(5);
c = new C(*b);
</code></pre>

<p>having a <code>B b;</code> private member for C</p>

<p>However for some reason I simply cannot get it to work properly, what is the obvious error I am making?</p>
