title: C++ how to call method in derived class from base class
body: <p>What I want to do is for <code>Execute()</code> to run and completes it calls the <code>Base::Done()</code> then calls the <code>Derived::Done()</code>. I'm doing this because <code>Base</code> class <code>Execute</code> will do something and when its done call the <code>Derived::Done()</code>. I hope I'm explaining it correctly.  Kind of like a listener that is called when a task completed. I'm kinda stuck on how the <code>Base</code> class will call the <code>Derived</code> class.</p>
  
  <pre><code>class Base
  {
    virtual void Done(int code){};
    void Execute();
  }
  
  void Base::Execute()
  {
  }
  
  
  class Derived : Base
  {
    void Done(int code);
    void Run();
  }
  
  Derived::Done(int code)
  {
  }
  
  void Derived::Run()
  {
      Execute();
  }
  </code></pre>