title: Calling ostream friend function of base class in c++
body: <p>So, I have two classes:</p>
  
  <pre><code>class Base {
      private:
          int number;
      public:
          friend ostream &amp; operator&lt;&lt;(ostream &amp; output, const Base &amp;n);
  }
  
  ostream &amp; operator&lt;&lt;(ostream &amp; output, const Base &amp;n) {
      output&lt;&lt;n.a&lt;&lt;endl;
      return output;
  }
  
  class Child : Base {
      private:
          int second;
      public:
          friend ostream &amp; operator&lt;&lt;(ostream &amp; output, const Child &amp;n);
  
  }
  
  ostream &amp; output&lt;&lt;(ostream &amp; output, const Child &amp;n) {
      output&lt;&lt;n.second&lt;&lt;Base:: ????&lt;&lt;endl;
      return output;
  }
  </code></pre>
  
  <p>My question is, how can i call the friend function of the base class from the child class to output its content: </p>
  
  <pre><code>output&lt;&lt;n.second&lt;&lt;Base:: ????&lt;&lt;endl
  </code></pre>
  
  <p>Thanks in advance :)</p>