This is a discussion on Memory allocated to variables of a function on different function calls within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by tabstop "Generated machine code" might be a little bit of a stretch, but presumably if you knew ...
That wasn't a theory I mentioned, it was a metaphor for the particular statement in question. By no means do I intend the same logic to apply to things willy-nilly. Really the original statement being discussed comes down to the author saying "assume nothing". Now you can make assumptions and then test those assumptions, but as I think you've now come to realise, that doesn't and in fact cant invalidate what the original statement says. Just assume no knowledge of the location of your variables is the intent the author is trying to get across here.
You simply misunderstood. It's not about not being worthy of proving, it makes no sense to try and prove, just like the no trespassing sign example, because it is not a statement about the behaviour that your compiled program will actually give.Revered Sir,
proving that might be an utter foolishness and worthless for you but for a humble beginner like me, the learning from the proof is worth its salt
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
Unless I experiment and post my doubts here, how can I learn that the statement at hand is the "world's-most-obvious-fact" ?
you being an experienced C++ expert, is in a position to make that call but for beginners like me experimenting and then asking the experts is the right way to proceed on the learning curve, in fact even to make the "obvious" distinction of whether the statement is about the behaviour that your compiled program will give or not, I have to experiment, thats the way I am because for me experimentation is the road to salvationIt's not about not being worthy of proving, it makes no sense to try and prove, just like the no trespassing sign example, because it is not a statement about the behaviour that your compiled program will actually give
I respectfully refuse to take things "granted" and I am determined to experiment and post as many foolish questions as I can, even though it may make me the laughing stock of the forum or bag me many funny jibes(or even "NoTrespassing" metaphors) or whatever, but I don't care until I am learningJust assume no knowledge of the location of your variables is the intent the author is trying to get across here.
Stay Hungry, Stay Foolish
Experimentation is good. But there are simply some things that you cannot get a proper understanding from through experimentation alone. Memory management like this is one of them, because it will be different from platform to platform and various circumstances.
If you want to know more, then you shouldn't experiment, but instead study operating system principles and see how they would deal with it.