标签:
bool b = 42; // _b is true_
int i = b; // _i has value 1_
i = 3.14; // _i has value 3_
double pi = i; // _pi has value 3.0_
unsigned char c = -1; // _assuming 8-bit chars_, _c has value 255_
signed char c2 = 256; // _assuming 8-bit chars_, _the value of c2 is__undefined_
类型所能表示的值的范围决定了转换的过程:
标签:
原文地址:http://www.cnblogs.com/star91/p/4782026.html