Hacker News new | ask | show | jobs
by asherkin 3268 days ago
It is a shorthand method of casting to a boolean value - C didn't have a true bool type until "recently" (but did have the concept of truthiness, where true is `is not 0`), so many projects and libraries use `#define TRUE 1`, and #define FALSE 0` or some similar variant.

So rather than write `foo ? TRUE : FALSE` or being more explicit `(foo != 0) ? 1 : 0`, you can just do `!!foo`.