please explain shift operation on negative numbers.
i executed a demo as below:
it yields d=0 ,which i could understand as it works like a normal shift operation where bits are discarded as they move out of the word and bits on right side get filled by all 0's,Code:char c=-1,d,e; d=c<<9; e=c>>9;
and e=-1,
and this i could not figure out as even after shifting it by 9 bits it holds the value intact.
any relevant explanation or reference would be a great help.