Code:#include<stdio.h> int main(void) { int x = 0; int z[] = {0,1,4,9,16,25,36,49,64,81}; int *p = z x= *(p+9) /*this will be 81*/ + *(p+3) /*this will be 9*/ + (10**(z+1)); /* i have no clue for this one*/ printf("x= %i\n", x); return 0; }
Code:#include<stdio.h> int main(void) { int x = 0; int z[] = {0,1,4,9,16,25,36,49,64,81}; int *p = z x= *(p+9) /*this will be 81*/ + *(p+3) /*this will be 9*/ + (10**(z+1)); /* i have no clue for this one*/ printf("x= %i\n", x); return 0; }
That was a tricky one, because to me, ** looked like it meant a power operator, as it does in Fortran and some other languages. I thought maybe there was a typing error in the code example above with a space missing so that it should have read
+ 10* *(z+1)
It turns out, space or not, it comes out to the same number without an overflow.
*(z+1) is the dereferenced 2nd element in z.
Correct, Sonny_E ** is does not exist as 'power' in C.