Which one is equivalent to multiplying by 2:
Left shifting a no. by 1 or Left shifting an unsigned int or char by 1 ?
Which one is equivalent to multiplying by 2:
Left shifting a no. by 1 or Left shifting an unsigned int or char by 1 ?
both? while they don't cause numeric overflow of unsigned int and unsigned char correspondingly
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
Both are while they don't overflow, but if the number is signed then the shift could make it negative.
thanx