assigning all properties of object of base class to derived one
<p>I have derived class D from base class B, like follow:</p>

<pre><code>class D : public B
{
//staff or nothing
}
</code></pre>

<p>I want to process received pointer <code>B* b</code>, in a way that declare 
<code>D* d</code>, and initialize <code>*d</code>  with all same property values from <code>*b</code>.
What is possible or best way to do it, if i have no rights to change <code>B</code> implementation?
Something like</p>

<pre><code>// I have pointer to B object, B* b received as a result of some function
class D : public B
{
//staff or nothing
}
D *d; //declaration 
// I want to initialize d, something like d=b (if that would be legal)
// or d = static_cast &lt;D*&gt;(b);
</code></pre>

<p>Thanks</p>
