title: error C2614: 'ChildClass' : illegal member initialization: 'var1' is not a base or member
body: <p>I am getting the following error in C++:</p>
  
  <blockquote>
    <p>error C2614: 'ChildClass' : illegal member initialization: 'var1' is
    not a base or member</p>
  </blockquote>
  
  <pre><code>Class Base 
  {
      protected:
      int var1;
  public:
      Base()
      {
          var1=0;
      }
  }
  
  
  class Child : public Base
  {
      int chld;
      public: 
      Child() : var1(0)
      {
          chld=1;
      }
  }
  </code></pre>
  
  <p>I feel what I have done is as per OO protocol. 
  Here <code>var1</code> is a data member of Base class with protected as the access specifier. So It can be inherited and it would become private in child. </p>
  
  <p><em>Don't understand why am I getting the error?</em></p>