Why is 0 < -0x80000000?
问题 I have below a simple program: #include <stdio.h> #define INT32_MIN (-0x80000000) int main(void) { long long bal = 0; if(bal < INT32_MIN ) { printf(\"Failed!!!\"); } else { printf(\"Success!!!\"); } return 0; } The condition if(bal < INT32_MIN ) is always true. How is it possible? It works fine if I change the macro to: #define INT32_MIN (-2147483648L) Can anyone point out the issue? 回答1: This is quite subtle. Every integer literal in your program has a type. Which type it has is regulated by