I am having problems with arrays it shows counting up to 127 when I execute the following code:
#include<iostream>
using namespace std;
int main()
{
int x[5];
int z=0;
while(1)
{
x[z]=z;
cout<<x[z];
z++;
}
}
My problems
- If I had given the maximum indexes of array 'x[5]', then why it is not throwing an exception on exceeding the limit.
- If it is exceeding, then it is stoped on the array's index 127 'x[127]'.
I'm using dev-c++ with TDM-GCC 4.9.2 64-bit Compiler.