title: Calling subclass' method in inherited virtual function?
body: <p>I am new to C++, but I was under the impression that virtual in C++ was the equivalent of abstract in Java. 
  I have the following: </p>
  
  <pre><code>//A.h
  class A {
  public:
      void method();
  protected:
      virtual void helper();
  }
  </code></pre>
  
  <p>With the following cpp:</p>
  
  <pre><code>//A.cpp
  #include "A.h"
  void A::methodA() {
      //do stuff
      helper();
  }
  </code></pre>
  
  <p>Then here's the derived class: </p>
  
  <pre><code>//B.h
  #include "A.h"
  class B: public A{
  private:
      void helper2();
  }
  </code></pre>
  
  <p>and the following derived cpp:</p>
  
  <pre><code>//B.cpp
  #include "B.h"
  
  void B::helper2() {
      //do some stuff
  } 
  
  void A::helper() {
      helper2();
  }
  </code></pre>
  
  <p>However, the compiler does not seem to like that I am calling the <code>helper2</code> method defined in the derived class, within a virtual method defined in the super class. It gives the error "error: ‘helper2’ was not declared in this scope". Is this not how I am supposed to use virtual methods?  </p>
  
  <p>Btw I can't use the keyword <code>override</code>. </p>