I'm surprised that this code compiles and works perfectly without throwing any errors!
int arraysize = 1000;
int array[arraysize];
for(int i=0; i<arraysize; i++)
{
array[i] = i+1;
}
for(int i=0; i<arraysize; i++)
{
cout << array[i];
}
Edit: Compiler used: i386-linux-gnueabi-g++ (Linaro GCC 4.5-2012.01) 4.5.4 20120105 (prerelease)