inheritance and pointer uses - advice for correct use
<pre><code>class A
{
public:
  A(int i):pi(&amp;i){}
  int* func()
  {
    //dosomething
    return pi;
  }
private:
  int*pi;
};

class B:public A
{
  A*pa;
public:
  int* bar()
  {
      //dosomething
      return pa-&gt;func();
  } 
};

int main()
{
   A*pa=new B();
   int*pi=pa-&gt;bar();
   delete pa;
   return 0;
}
</code></pre>

<p>Could someone please provide any tips if my above classes (I narrowed it smaller for better view) are good to enter ? I am a little worried that I pick a wrong choice.</p>
