I have read that global arrays are initialized to 0 by default. I tried experimenting with local arrays and declared one in the main function.
int main()
{
int* x = new int[10];
int i;
for(i=0;i<10;i++)
{
cout<<x[i]<<" ";
}
return 0;
}
I got the output as: 0 0 0 0 0 0 0 0 0 0
Are local arrays always initialized to 0? I am using CodeBlocks GCC if its of any help.