Darren New <dne### [at] san rr com> wrote:
> Or, maybe more clearly....
> a = 5; b = a; a++;
> This doesn't change the value in 'b'.
I don't even understand why it should, if you are handling value-based
variables.
> You're not incrementing the value in
> 'a'. You're replacing the value in 'a' with a new value.
"a++" probably results in an assembler machine code which makes the CPU
increment the value of a memory location by one. Exactly how the bits go
through the transistors in order to achieve this feels irrelevant. It's
the end result that matters: You modified the value of the variable.
--
- Warp
Post a reply to this message
|