I have an array with 6 elements, but when I try to access arr[6], it gives me a garbage value instead of array overflow error. What is the reason behind this?
#include
#include <bits/stdc++.h>
using namespace std;
int main()
{
int arr[] = {3, 2, 1, 56, 10000, 167};
cout << "Value: " << arr[6];
return 0;
}