在c中,在布尔中,true == 1和false == 0?
问题描述:
为澄清起见,我找到了类似的答案,但对于C ++,我对编码有点陌生,所以我不确定它是否也适用于C.
Just to clarify I found similar answer but for C++, I'm kinda new to coding so I'm not sure whether it applies to C as well.
答
更准确地说,任何不是0
的东西都是正确的.
More accurately anything that is not 0
is true.
1
是真实的,但是2
,3
...等也是
So 1
is true, but so is 2
, 3
... etc.