title: Friend function Random behaviour
body: <pre><code>#include&lt;iostream&gt;
  
  class FooA
  {
  private :
  friend class FooB;
      void Hello();
      void Hello2();
  private:
      void Hello3();
      int m_iData;
  };
  
  class FooB
  {
      void fun()
      {
          FooA objA;
          objA.Hello();  // right
          objA.Hello2(); // right
          objA.Hello3(); // right
          //ojbA.m_iData = 0; // compile error 
      }
  };
  </code></pre>
  
  <p>usually if we access Data member Function or Member variable which is private by an object directly throws error.</p>
  
  <p>but in this scenario how it is able to access Hello(),Hello2(),Hello3() Functions and why it's throwing error in accessing m_iData.</p>