类型转换
/*
类型转换
*/
#include<iostream>
int main() {
bool b = 23; //b为真
std::cout << "b=" << b << std::endl;
int i = b;
std::cout << "i=" << i << std::endl;
i = 3.1415926;
std::cout << "i=" << i << std::endl;
double pi = 3.1415;
std::cout << "pi=" << pi << std::endl;
int p = pi;
std::cout << "p=" << p << std::endl;
unsigned char c = -1;
std::cout << "c=" << c << std::endl;
signed char c2 = 256;
std::cout << "c2=" << c2 << std::endl;
system("pause");
return 0;
}