《剑指offer》第一问
**
在c++中有哪四个与类型转换相关的关键字?有什么特点?
**
C++与类型转换相关的四个关键字有:const_cast, static_cast, dynamic_cast, reinterpret_cast
static_cast——运算符完成相关类型之间的转换
特点:静态转换,在编译处理期间。
应用场合:完成基本数据类型之间的转换,但是无法保证转换的安全性
例如int类型到double,...
原创
2020-03-12 12:44:49 ·
86 阅读 ·
0 评论