This was an exam problem that I still don't really understand
Asking for the outputCode:int main () int a[10] = {1,2,3,4,5,6,7,8,9,10}; int *ptr = (int*)(&a + 1); printf("%d %d, *(a+1), *(ptr-5) ); return 0;
I understand that *(a+1) == 2
but
how does *(ptr-5) == 6?
It makes sense to me that *(ptr+5) == 6.. but dont know how *(ptr-5) == 6?
thanks in advance