title: C++ fix unused parameter warning with polymorphism
body: <p>I get some compiler warnings for my program concerning unused variables, and I would like to know what is an appropriate way to fix this.</p>
  
  <p>I have a function that gets inherited by the base class, and in the implementation of the function for the parent I don't use all parameters that are needed for the child; of course this leads to warnings, and as I am not an experienced programmer I am not sure what is the best way to fix those warnings.</p>
  
  <p>So an minimal example would be:</p>
  
  <p>In the header:</p>
  
  <pre><code>    class car{
       public:
         virtual void init(int color, int size)
       private:
         int size;
      }
      class sportscar : public car{
       public:
         virtual void init(int color, int size)
       private:
         int color;
         int size;
      }
  </code></pre>
  
  <p>In the source file:</p>
  
  <pre><code>    void car::init(int color, int size){
        this-&gt;size = size;
      }
      void sportscar::init(int color, int size){
        this-&gt;color = color;
        this-&gt;size = size;
      }
  </code></pre>