title: How to access parent class function from derived class object in function over riding feature of C++
body: <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  class base
  {
  public: void getdata()
          {
              cout&lt;&lt;&quot;in base&quot;&lt;&lt;endl;
          }
  };
  
  class derived:public base
  {
  public: void getdata()
          {
              cout&lt;&lt;&quot;in derived&quot;&lt;&lt;endl;
          }
          void base:: getdata()
  };
  
  int main()
  {
  derived d;
  d.getdata();
  return 0;
  }
  </code></pre>
  <p>I'm getting error: &quot;cannot declare member function 'base::getdata' within 'derived'&quot;</p>
  <p>I want to print the content of both functions from derived class objects</p>