title: Why I have to redeclare a virtual function while overriding [C++]
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class Duck {
  public:
          virtual void quack() = 0;
  };
  
  class BigDuck : public Duck {
  public:
    //  void quack();   (uncommenting will make it compile)
  
  };
  
  void BigDuck::quack(){ cout &lt;&lt; "BigDuckDuck::Quack\n"; }
  
  int main() {
          BigDuck b;
          Duck *d = &amp;b;
          d-&gt;quack();
  
  }
  </code></pre>
  
  <p>The code above doesn't compile. However, when I declare the virtual function
  in the subclass, then it compiles fine.</p>
  
  <p>If the compiler already has the signature of the function that the subclass will override, then why is a redeclaration required?</p>
  
  <p>Any insights?</p>