title: Why can't a Base class object be assigned to a Derived class object?
body: <p>A <strong>derived class object</strong> can be assigned to a <strong>base class object</strong> in C++.</p>
  
  <pre><code>Derived d;
  Base b = d; // It's Ok
  </code></pre>
  
  <p>But why can't a <strong>base class object</strong> be assigned to a <strong>derived class object</strong>?</p>
  
  <pre><code>Base b;
  Derived d = b; //Not Ok. Compiler give an error
  </code></pre>
  
  <p><strong>Edit:</strong> </p>
  
  <p>Sorry, but this question was actually asked durring an interview.</p>