Originally posted by Arthur Blair:
Ok, I understand that shift operator operands are promoted to an int before the shift is run. But it is not clear what is happening on line (1). Why do I not need to cast here (1) when I need to do an explicit cast on line (3).
Thoughts appreciated.
that is the way shortcut assignment operators work
accutally
b<<=2 is b=(cast)b<<2
refer K&B chapter 3