For arrays with more given elements than its size, why does doing a[i] print garbage value but *a+i brings the correct value, despite them being the same thing (a[i] = *a+i)
int a[2] = {1,2,3,4};
for ( int i =0 ; i<=4 ;i++){
printf(“%d” , a[i]; // gives 1, 2, Garbage , Garbage
printf(“%d”, *a+i; // gives 1, 2, 3, 4
}