title: assigning derived class pointer to base class pointer in C++
body: <p>I have following</p>
  <pre><code>class base
  {
  };
  
  class derived : public base
  {
    public:
     derived() {}
     void myFunc() { cout &lt;&lt; &quot;My derived function&quot; &lt;&lt; std::endl; }
  
  };
  </code></pre>
  <p>now I have</p>
  <pre><code>base* pbase = new derived();
    pbase-&gt;myFunc();
  </code></pre>
  <p>I am getting error myFunc is not a member function of base.</p>
  <p>How to avoid this? and how to make myFunc get called?</p>
  <p>Note I should have base class contain no function as it is part of design and above code is part of big function</p>