suppose this code:
main()
{
int *x;
*x = 3;
printf("%d %d %d\n", *x, &x, x);
// output 3 5448392 2293524
}
if *x
is the value; &x
the addres; what does mean that value of x
?
*x
is the value (correct)x
is the address of the value. EDIT In your case, this address is uninitialized, so it is not pointing anywhere in particular (thanks Keith Nicholas for mentioning this).&x
is the address of the [pointer that should contain the] address of the value.(it's worth pointing out that your program may crash :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With