title: the protected and private member variables in C++ inheritance
body: <p>I am a newbie to C++, I have a question regarding to the c++ protected and private members in inheritance.</p>
  
  <p>If a class is public inherits a based class, does the protected and private member variable will be part of derived class?</p>
  
  <p>For example:</p>
  
  <pre><code>class Base
  {
     protected: 
         int a;
         int b;
     private:
         int c;
         int d;
     public;
         int q;
  };
  
  class Derived: public Base
  {
  
  };
  </code></pre>
  
  <p>does class Derived also have all the member of <code>a, b, c, d, q</code>? and can we define a <code>int a</code> as public, protected, and private in Derived class?</p>