C++Primer ch4笔记

1.

bool类型参加运算时会提升为int类型。

bool fuck, shit;
fuck = true;    
shit = -fuck;
// shit == true !

2.

wrapped around现象:

short fuck = 32767;
fuck++;
std::cout << fuck;
// fuck == -32768

 

posted @ 2017-02-28 20:38  codinRay  阅读(95)  评论(0编辑  收藏  举报