Array initialization in c++?
<pre><code>int main()
{
    clrscr();
    int x[3];
    int n;
    cout&lt;&lt;"Enter the array size= ";
    cin&gt;&gt;n;
    cout&lt;&lt;"Enter the elements for array= ";
    for(int i=0;i&lt;n;i++)
    {
        cin&gt;&gt;x[i] ;
    }
    for(i=0;i&lt;n;i++)
    {
        cout&lt;&lt;"x["&lt;&lt;i&lt;&lt;"]="&lt;&lt;x[i]&lt;&lt;"\n";
    }
    getch();
    return 0;
}
</code></pre>

<p>When m trying the same logic in c# then I got the right output as if I enter the size of array more than I initialize it gives the exception. But in c++ m not getting any type of error neither on compilation time nor at run time. But according to rule it should be give some error at run time in output if i give array size more than I initialize. And one thing more why it determine the 09 as two numbrs not single as 90 it shows it 0 and 9 at differect index as in output.  </p>

<p><img src="http://i.stack.imgur.com/qJNCZ.jpg" alt="output"></p>

<p><img src="http://i.stack.imgur.com/juf18.jpg" alt="enter image description here"></p>
