title: Error : base class constructor must explicitly initialize parent class constructor
body: <p>I am new to c++. When I try to compile the code below , I get this error </p>
  
  <p><code>constructor for 'child' must explicitly initialize the
        base class 'parent' which does not have a default constructor
  child::child(int a) {</code></p>
  
  <p>here is my class </p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include&lt;iostream&gt;
  using namespace std;
  
  class Parent
  {   
  public :
      int x;
      Parent(int a);
      int getX();
  };
  Parent::Parent(int a)
  {
      x = a;
  }
  int Parent::getX() 
  {
      return x;
  }
  class Child : public Parent
  {
  public:
      Child(int a);   
  };
  Child::Child(int a) 
  {
      x = a;
  }
  int main(int n , char *argv[]) 
  {
  
  }
  </code></pre>
  
  <p>Why I am getting this error ?
   How can I resolve it ?
  Thanks in advance</p>