Code:
\*It is assumed that the addresses of the
variables i, j and the first element of the integer array num in hexadecimal are
22FF6C, 22FF68, 22FF40 respectively.*\
int i, j = 3;
int *pi = &i, *pj = &j;
int num[5]={25, -1, 3, 12, 100};
printf("%x, %x, %x\n", &i, &j, num);
printf("%x, %x\n", pi, pj);
j++;
*pj *= 3;
printf("%x, %d\n", pj, *pj);
pi = num;
num[0] += 5;
printf("%x, %d\n", pi, *pi);
printf("%x, %d\n", pi+j, *pi+j);
*pj = *pj - 8;
printf("%x, %d\n", pj, *pj);
printf("%x, %d\n", pi+num[2], *(pi+num[2]));
I've printed all correct upto the last point. For , pi+num[2], I got 22ff1c. For *(pi+num[2]), what values are used? I thought it would have been 30+3 = 33 but it's 12. Surely if adding three address and then finding the value would give 33?
Can someone help me with my confusion? Thanks in advance.