Y
Hacker News
new
|
ask
|
show
|
jobs
by
lostmsu
2370 days ago
This sounds like an implementation detail. What does the language spec say about the outcome.
2 comments
a1369209993
2370 days ago
The (C) language spec says that:
x = 5; int* p = &x; x = 6; // new binding of x printf("%i\n",*p);
prints "6". If new bindings lived at different addresses, it would print "5".
link
AgentME
2370 days ago
Different bindings are like entirely different variables that just coincidentally share the same name.
link