So I have to find out why specific values are printed out, and I've solved most of it but, I've got a problem with the last three.
I'd be happy for any help
int main(void)
{
int myValues[] = { 9, 0, 12345, 1, 7, 2, 6, 3, 5, 4 };
mess(&myValues[3]); //starts function mess
}
void mess(int *n)
{
printf("mess :%d\n", *n++); //prints value of 3rd index (1) and sets pointer to fourth index
printf("mess: %d\n", *++n); //sets n to 5th index and prints its value
printf("mess: %d\n", -2[n]); //value: -3
printf("mess: %d\n", (-2)[n]); //value: 1
printf("mess: %d\n", n[-6]); //value: 32766
}
I just don't understand how the values -3, 1 and 32766 come to be