Why sizeof (int) is not greater than -1?
2 answers
Because sizeof gives a value of type size_t , which is an unsigned type. In the expression > regular arithmetic conversions convert -1 to an unsigned type, which is the result type > . The resulting value will be a large positive value.
To use the expected behavior:
(int) sizeof (int) > -1 +4