CPP基础类型转换
2015-06-03 17:48:21 1 举报
C++基础类型转换
作者其他创作
大纲/内容
float
T*
sizeof(int) sizeof(long)
~0 - true0 - false
charuchar
sizeof(short) = sizeof(int)
ushort
integerfloatchar
3nd
long
uint
double
bool
宽
integercharbool
窄
long double
int
强制转换否则语法错误
true - 1false - 0
强制转换
1st
enum依赖1.底层实现类型2.所有值最小整数类型
short
void*
char
警告无需强制
2nd
sizeof(int) = sizeof(long)
integer
ulong
static_cast()
sizeof(short) sizeof(int)
0 条评论
下一页