Does UINT_MAX have all bits set to 1?
问题 This question is asked before but I am still confused. I know that unsigned int a = -1; would be UINT_MAX . But it is not because all bits of -1 is set. C11 says if the new type is unsigned, the value is converted by repeatedly adding or subtracting one more than the maximum value that can be represented in the new type until the value is in the range of the new type So lets say UINT_MAX is 100 (I know it should be greater then 2^16-1 but lets ignore this for now) unsigned int a = -1; // will