So, I'm following "Let Us C" book, and they have an example for pointers, can you explain why the value of i
and j
change values in this scenario?:
main( )
{
int i = 3, *j, **k ;
j = &i ;
k = &j ;
printf ( "\nAddress of i = %u", *k ) ;
printf ( "\nAddress of j = %u", &j ) ;
}
Output
Address of i = 65524
Address of j = 65522
I understand in C
that new variable declarations for example int i =3; int k=5
are assigned different memory locations by C, just cant seem to wrap my head around why this is outputting different values?