News for hackers. Stuff that matters.
Re:Q: Why can I access an out-of-scope C++ var? A: So you re... by olavk on Thursday June 23, 2011 @03:42AM (#2687065)
The analogy is supposed to explain the concept of undefined behavior, not the details of memory management.

If you are used to safe languages, the concept of undefined behavior might be confusing. In those languages, an operation is either allowed or not allowed, and if it is allowed it has well-defined behavior. In C a number of operations does not have well-defined results, but is still technically possible to perform, or might be possible depending on circumstances. But you shouldn't use them. The analogy is supposed to explain that.

Re:Q: Why can I access an out-of-scope C++ var? A: So you re... by sliverstorm on Thursday June 23, 2011 @11:06PM (#2690809)
undefined behavior is fun. All this stuff gets a lot more interesting in microcontrollers, where security is not an issue and you sometimes have to manage memory directly and store data between power cycles.