Consider the program below.
# include <iostream>
int main()
{
int* arr{new int[3]{9, 8, 7}};
std::cout << arr[67];
}
Why does this program always print 0 in my machine? Shouldn't this print some garbage value instead? As dynamic arrays are almost identical to fixed arrays.