Why I am getting UMR(unInitialized Memory Read)Error in following code snippet
<p>Why I am getting UMR(unInitialized Memory Read)Error in following code snippet.
I am getting UMR error while calling copy constructor of derived class</p>

<pre><code>class base{
public :

    base(int);
    int id;

    int getid()
    {
        return id;
    }
};

base::base(int a)
{
    id = a;
}

class derived:public base{
public :
    derived(derived &amp;);
    int inum;

    int getnum()
    {
        return inum;
    }

};

derived::derived(derived &amp;d):base(d.getnum()) // UMR Error
{
    inum = id;
}
</code></pre>

<p>Can anybody have any idea what is wrong with the implementation?</p>
