6 ms·
It is very common in C code, where for most of its history you hadn't any explicit boolean data type but used int, following the rule that zero is false and any
by slrz 9y ago
It is very common in C code, where for most of its history you hadn't any explicit boolean data type but used int, following the rule that zero is false and anything else is true.
The '!!expr' is the idiom most people use whenever the need for a canonical 0/1 representation arises.