摘要:
这两天看书发现了一些小细节,以前没注意到,列举出来:1.关于bool型bool b = 12;int a = b;现在将a输出,发现它的值是1,相应b也是1.书上解释如下 “When we assign one of the nonbool arithmetic types to a bool object, the result is false if the value is 0 and true otherwise.”2.关于unsigned型用下面的代码测试#includeusing namespace std;int main(){ unsigned char c = -1; ... 阅读全文
posted @ 2013-11-22 22:52
水蛋壳
阅读(216)
评论(0)
推荐(0)
浙公网安备 33010602011771号