Confusion in output
<p>Consider the following program.   </p>

<pre><code>#include&lt;iostream&gt;
using namespace std;

class base
{

   public:
     int _bval;

     base():_bval(0){}
};

class derived:public base
{

   public:
     int _dval;

     derived():base(),_dval(1){}
};

int main()
{     

   derived d[5];
   base *p;
   p=d;
   for(int i=0;i&lt;5;++i,++p)
      cout&lt;&lt;p-&gt;_bval;

}
</code></pre>

<p>The output of the above program is 01010.<br>
I thought the output would be 00000 because the value of _bval was initialized to 0(each time) by the base class constructor. </p>

<p>But why is the output different from 00000?<br>
What am I missing?</p>
