title: No Matching Constructor For Initialization
body: <p>I'm just supposed to be getting used to basic copy constructors.</p>
  
  <p>I assumed I properly placed copy constructors.</p>
  
  <p>But when I try to compile, I keep getting the error "No matching constructor for initialization of B"</p>
  
  <p>I'm a bit confused.</p>
  
  <pre><code>class A {
      int valuea;
  
  public:     
      A(const A&amp;); // copy constructor
      int getValuea() const { return valuea; }
      void setValuea(int x) { valuea = x; }
  };
  
  class B : public A {
      int valueb;
  public:
      B(int valueb);
      B(const B&amp;); // copy constructor
      int getValueb() const { return valueb; }
      void setValueb(int x) { valueb = x; }
  };
  
  int main () {
      B b1;
      b1.setValuea(5);
      b1.setValueb(10);
      B b2(b1);
      cout &lt;&lt; "b2.valuea="  &lt;&lt; b2.getValuea() &lt;&lt; "b2.valueb="  &lt;&lt; b2.getValueb() &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>