Why will C++ copy constructor fail?
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;

using namespace std;

class A
{
public:
    A() { i=1; j=2;};
    A (A &amp;obj) { i= obj.i+100; j= obj.j+100;};
     int i;
     int j;
};

class B:public A
{
public:
    B():A() {i=10; j=20; k=30;};

    B(A &amp;obj) {  A::A(obj); k=10000; };//

    int k;
};

int main()
{ 
    A dog;
    B mouse(dog);
    cout&lt;&lt;mouse.i&lt;&lt;endl;
    cout&lt;&lt;mouse.k&lt;&lt;endl;

    return 0;
}
</code></pre>

<p>I try to write a copy constructor for the derived class that takes advantage of the copy constructor for the base class. I expect that <code>mouse.i</code> should be 101, but in fact the compiling result is 1. The value for <code>mouse.k</code> is 10000, which is expected. I was wondering what's wrong with my code.</p>
