4 ms·
They aren’t testing for ‘false’ in this case but for success. Functions which return 0 on success I always compare with 0 as “if (foo()) error();” easily gets
by UncleEntity 4y ago
They aren’t testing for ‘false’ in this case but for success.
Functions which return 0 on success I always compare with 0 as “if (foo()) error();” easily gets confusing. If I see “if (foo() != 0) error();” then I can easily tell what’s going on because C is funny like that.
Conversely, if I’m testing for truthfulness or NULL I’ll use the boolean operators.