title: C++ Virtual function implementation?
body: <p>If I have in C++:</p>
  
  <pre><code>class A {
      private: virtual int myfunction(void) {return 1;}
  }
  
  class B: public A {
      private: virtual int myfunction(void) {return 2;}
  }
  </code></pre>
  
  <p>Then if I remove <code>virtual</code> from the <code>myfunction</code> definition in <code>class B</code>, does that mean that if I had a <code>class C</code> based on <code>class B</code>, that I couldn't override the <code>myfunction</code> since it would be statically compiled?</p>
  
  <p>Also, I'm confused as to what happens when you switch around public, and private here. If I change the definition of <code>myfunction</code> in <code>class B</code> to be public (and the one in <code>class A</code> remains private), is this some sort of grave error that I shouldn't do? I think that virtual functions need to keep the same type so that's illegal, but please let know if that's wrong.</p>
  
  <p>Thanks!</p>