I always thought if I accessed an array index greater than the array size that it would cause a runtime error? But it seems to be happy to run and output zero. Is this compiler specific or OS specific? Will some different environments cause a runtime error when you access an array index greater than the array size?
For eg;
int foo[5];
cout << foo[5] << endl;
vector<int> bar(5);
cout << bar[5] << endl;