3 ms·
Yes, if you're an idiot. No, if you're not. EDIT: okay, I'm getting downvoted. But the truth of the matter is, its highly dependent on if the developer under
by fit2rule 13y ago
Yes, if you're an idiot. No, if you're not.
EDIT: okay, I'm getting downvoted. But the truth of the matter is, its highly dependent on if the developer understands what they're doing. In both the cases where the developer knows, or the developer doesn't know, either way - accessing variables off the stack in this way, with a flying pointer, is pretty idiotic. Its not going to result in great software, people ..
- coldtea 13y agoYou're getting downvoted because: 1) It's not a great insight in the first place. It's common sense and well known that you shouldn't access data this way. 2) It doesn't answer the question, which is about the mechanics (how does it happen?), not the quality of the programmer (what kind of programmer does that?) 3) It's needlessly insulting. 4) It's plainly wrong. It might be "idiotic" to access memory this way, but that doesn't mean that only idiots do it, either with intent (e.g to hack into something, or speed up some code with pointer arithmetic), or without (e.g by accident). It can happen (and it has happened) even to Dennis Ritchie.
- redblacktree 13y agoNot Kernighan though. He'd never make a mistake like that.