true == 1;
true + 1;
If the destination type is bool, see 4.12. If the source type is bool, the value false is converted to zero and the value true is converted to one.
在算数运算中 bool
类型会被提升成整型,true
会被转换成 1
,false
会被转换成 0
。
标签:false,运算,type,bool,算数,true From: https://www.cnblogs.com/revc/p/17185008.html参考资料