How is if statement evaluated in c++?

derrdji picture derrdji · Sep 25, 2009 · Viewed 36.9k times · Source

Is if ( c ) the same as if ( c == 0 ) in C++?

Answer

Jesper picture Jesper · Sep 25, 2009

No, if (c) is the same as if (c != 0). And if (!c) is the same as if (c == 0).