Wrap around explanation for signed and unsigned variables in C?
问题 I read a bit in C spec that unsigned variables(in particular unsigned short int ) perform some so called wrap around on integer overflow, although I couldn\'t find anything on signed variables except that I left with undefined behavior . My professor told me that their values also get wrapped around (maybe he just meant gcc). I thought the bits just get truncated and the bits I left with give me some weird value! What wrap around is and how is it different from just truncating bits. 回答1: