This is getting more confusing. Can you please elaborate a bit more on 'anything'. |
It's really very simple... if it's confusing you are over-thinking it. But I'll try to elaborate:
C++ is a language. It has a set of "rules" which dictate how things work.
For example... the language says that if you input an expression like so:
5 + 10
, it will result in the sum of those two numbers, giving you 15. This will
always happen because the language says it will. It's guaranteed. It's how the language works. It's one of its rules.
There is no such guarantee for what you're doing. There's no rule. It's outside what the language says will happen. Therefore
anything can happen.
The thing I'm not understanding is why the output always gives a fixed value, when it can be anything? |
"Anything" means, quite literally, "any" "thing".
31 is a thing.
If I can have "any" thing... then that means I could have 31.
64 is also a thing. Therefore if I can have anything that means I could also have 64.
Just because
you are getting 31 now... doesn't mean everyone always will. Someone could get something else. Anything could happen.
EDIT:
To rephrase... these are all "things":
- 31
- 64
- 32
- 30
- program crashes
- -781264687
"anything" means that any of those things can happen.