It's possible that you might want an int variable that's either 1
or 0
.
So you can't for example pass a 5
, instead the double negation would turn that 5
into a 1
.
Also, have a look at how TRUE
is defined:
#ifndef TRUE
#define TRUE 1
#endif
Therefore, an expression like:
int x = 5;
if ( x == TRUE )
{
//....
}
would not pass, whereas
if ( x )
{
//....
}
would.