title: Friend Function can't access private member of private member
body: <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class A {
      friend void print(B&amp;);
      int number;
  };
  
  class B {
      friend void print(B&amp;);
      A object;
  };
  
  void print(B&amp; C) {
      cout &lt;&lt; C.object.number;
  };
  </code></pre>
  <p>This code won't compile. It gives me E0265 error (member A::number is inaccessible)</p>