Why does right shifting negative numbers in C bring 1 on the left-most bits? [duplicate]
问题 This question already has answers here : Are the shift operators (<<, >>) arithmetic or logical in C? (11 answers) Closed 4 years ago . The book "C The Complete Reference" by Herbert Schildt says that "(In the case of a signed, negative integer, a right shift will cause a 1 to be brought in so that the sign bit is preserved.)" What's the point of preserving the sign bit? Moreover, I think that the book is referring to the case when negative numbers are represented using a sign bit and not