reinterpret_cast

reinterpret_cast强制类型转换符

用法:

new_type a = reinterpret_cast <new_type> (value)

将value的值转成new_type类型的值,a和value的值一模一样。比特位不变

reinterpret_cast用在任意指针(或引用)类型之间的转换;以及指针与足够大的整数类型之间的转换;从整数类型(包括枚举类型)到指针类型,无视大小。

需要注意的是:reinterpret_cast<xx>(yyy),xx与yyy必须有一个值为指针类型。

原文地址:https://www.cnblogs.com/swjtumao/p/10552501.html