23-02-2009, 11:14 AM
But you are testing against zero, rather than NULL. The difference is subtle, and only a matter of coding style. This cannot cause any problems, but it can perhaps cause implicit typecast warnings.
I interpret the rule as "everything that isn't Boolean should be explicitly tested". Consider this:
if(!y)
If y is a pointer, this is surely poor coding style, since ! is a pure Boolean operator.
I interpret the rule as "everything that isn't Boolean should be explicitly tested". Consider this:
if(!y)
If y is a pointer, this is surely poor coding style, since ! is a pure Boolean operator.
<t></t>