please explain shift operation on negative numbers. i executed a demo as below: Code: char c=-1,d,e; d=c9; 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, 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.
how is it possible if it is thought from a variable point of view?? computer does not discriminate between c and e... variable can be anything...can you post a full proof code so that i can test that in my system...?