The following code gets compiled
int v[] = { 0,1,2,3,4,5,6,7,8,9 };
std::cout << v[10] << std::endl;
int x;
int* ptr = &x;
std::cout << *ptr << std::endl;
I would like to understand why it was possible to display v[10] and *ptr and also why v[10] and *ptr have the same value. Could you please provide an explanation?