title: Redefine Virtual Functions between header files in C++
body: <p>I have one header file which uses a virtual function.</p>
  
  <p>This is declared and defined:</p>
  
  <pre><code>#ifndef HeaderH
  #define HeaderH
  
  class Base {
  &lt;some code&gt;  
  public:virtual int checkVal(int&amp; val) { return val;} 
  };
  #endif
  </code></pre>
  
  <p>I have another header file which declares some functions, and inherits from this base header.</p>
  
  <p>Finally, I have the implementation of this header file in another .cpp file:
  I want to override the virtual function checkVal in my implementation here, but I keep getting a redefinition error.</p>
  
  <pre><code>int Base::checkVal(int&amp;  value)
  {
    if(value == 0)
          value = 10;
    return value;
  }
  </code></pre>
  
  <p>Is there something I should include in my header file which will override the Base virtual function? </p>