I came across an article which mentioned that the result of !0 is compiler dependent. The result can be either 1 or FF or FFFF and so on.
As for C99 standard 6.5.3.3 Unary arithmetic operators,
The result of the logical negation operator ! is 0 if the value of its operand compares unequal to 0, 1 if the value of its operand compares equal to 0. The result has type int. The expression !E is equivalent to (0==E).
Is it really compiler dependent?
~0
is platform dependent. – Passacaglia