I declared an integer array on heap like this
int* a = new int[100];
and then I initialized it like this
for(int i=0; i<100; i++)
a[i] = i;
which worked perfectly but then I tried this
for(int i=0; i<1000; i++)
a[i] = i;
which also worked perfectly.Since I am a newbie to c++ can anyone explain what's the problem in this above declaration because I think the declaration of integer array is not proper or might be anything else?