PORTB = DATA >> i;
I am attempting to put a bit shifted version of DATA into PORT B
question is:
does the above line of code change the variable DATA at all, or is it still the original value that it had before this line of code??
PORTB = DATA >> i;
I am attempting to put a bit shifted version of DATA into PORT B
question is:
does the above line of code change the variable DATA at all, or is it still the original value that it had before this line of code??
DATA maintains its old value. It's just like a = b + c doesn't change the value of b.
If you understand what you're doing, you're not learning anything.
Only the assignment operators (=, +=, >>=) change the value of their operands, and then only the lvalue is modified (the variable on the left).
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.