int *pt = 0; long i = reinterpret_cast<long>(pt);
我保证是0吗?这是明确定义还是实现定义?我检查了c ++标准,但它只说明了这一点
指向数据对象或函数(但不是指向成员的指针)的指针可以转换为足以包含它的任何整数类型.
在这种情况下,pt不指向任何数据对象.该规则适用于此案吗?
c++ type-conversion reinterpret-cast
c++ ×1
reinterpret-cast ×1
type-conversion ×1