在 C++ 中如何评估 if 语句?

2021-12-12 00:00:00 if-statement c++ evaluation

if ( c ) 和 C++ 中的 if ( c == 0 ) 一样吗?

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

推荐答案

否,if (c)if (c != 0) 相同.而 if (!c)if (c == 0) 是一样的.

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

相关文章