Nested class display member value
<pre><code>class A
{
   public:
   class B
   {
       private:
         int ii;

   };
   void print(){cout&lt;&lt;B::ii&lt;&lt;endl;}
};
</code></pre>

<p>My compiler says I can't access the interger inside ii;
I search through this site and come up with friend key
I change it into </p>

<pre><code>class A
{
   public:
   class B
   {
       private:
         int ii;

   };
   friend void print(){cout&lt;&lt;B::ii&lt;&lt;endl;}
};
</code></pre>

<p>But it doesn't work too. Can you help me ?
I am stuck.really really really sad as no way out!</p>
